VibeKoding / Ensiklopedia Β· Fondasi KuatEnsiklopedia Β· Fondasi Kuat / Principles of Domain Names, DNS, and HTTPSPrinciples of Domain Names, DNS, and HTTPS
VK

Principles of Domain Names, DNS, and HTTPSPrinciples of Domain Names, DNS, and HTTPS

πŸ“š Ensiklopedia Β· Fondasi KuatEnsiklopedia Β· Fondasi Kuat 🌏 Dual Bahasa (ID / EN) ⚑ VibeKoding Native

Ensiklopedia VibeKoding: Principles of Domain Names, DNS, and HTTPS.Ensiklopedia VibeKoding: Principles of Domain Names, DNS, and HTTPS.

πŸ’‘ Tips PraktisπŸ’‘ Pro Tip

When you type www.google.com in your browser and press Enter, what happens behind the scenes? This seemingly simple action involves a series of precisely coordinated processes: domain name resolution, DNS queries, and TLS encryption handshakes. Understanding these mechanisms is essential for every developer β€” it directly determines whether your website can be accessed and whether your data can be intercepted.When you type www.google.com in your browser and press Enter, what happens behind the scenes? This seemingly simple action involves a series of precisely coordinated processes: domain name resolution, DNS queries, and TLS encryption handshakes. Understanding these mechanisms is essential for every developer β€” it directly determines whether your website can be accessed and whether your data can be intercepted.

What will you learn from this article?What will you learn from this article?

After completing this chapter, you will gain:After completing this chapter, you will gain:

ChapterContentCore Concepts
Chapter 1DNS ResolutionRecursive queries, iterative queries
Chapter 2DNS RecordsA, CNAME, MX, TXT
Chapter 3HTTPS and TLSHandshake process, encrypted communication
Chapter 4Certificate Trust ChainCA, root certificates, intermediate certificates
Chapter 5HTTP vs HTTPSPlain text vs encrypted, security comparison

------

0. Big Picture: From Domain Names to Secure Connections0. Big Picture: From Domain Names to Secure Connections

Internet communication is based on IP addresses (like 142.250.80.46), but humans can't remember these numbers. So we invented the Domain Name System (DNS) β€” the internet's "phonebook" that translates human-readable domain names into machine-readable IP addresses.Internet communication is based on IP addresses (like 142.250.80.46), but humans can't remember these numbers. So we invented the Domain Name System (DNS) β€” the internet's "phonebook" that translates human-readable domain names into machine-readable IP addresses.

But finding the server isn't enough. If communication is transmitted in plain text, any man-in-the-middle can eavesdrop on or tamper with your data. HTTPS solves this problem β€” it adds a layer of TLS encryption on top of HTTP, ensuring the confidentiality and integrity of data during transmission.But finding the server isn't enough. If communication is transmitted in plain text, any man-in-the-middle can eavesdrop on or tamper with your data. HTTPS solves this problem β€” it adds a layer of TLS encryption on top of HTTP, ensuring the confidentiality and integrity of data during transmission.

πŸ’‘ Tips PraktisπŸ’‘ Pro Tip

1. Domain Resolution: The browser asks DNS "What's the IP for www.google.com?" DNS responds "142.250.80.46" 2. TCP Connection: The browser establishes a TCP three-way handshake with the server 3. TLS Handshake: Both parties negotiate encryption algorithms, verify certificates, and exchange keys 4. Encrypted Communication: All HTTP data is transmitted through the encrypted channel1. Domain Resolution: The browser asks DNS "What's the IP for www.google.com?" DNS responds "142.250.80.46" 2. TCP Connection: The browser establishes a TCP three-way handshake with the server 3. TLS Handshake: Both parties negotiate encryption algorithms, verify certificates, and exchange keys 4. Encrypted Communication: All HTTP data is transmitted through the encrypted channel

------

1. DNS Resolution: The Internet's "Phonebook"1. DNS Resolution: The Internet's "Phonebook"

DNS (Domain Name System) works like looking up a phonebook: you know the other person's name (domain name) and need to find their phone number (IP address). But the internet's "phonebook" isn't a single book β€” it's a hierarchical, distributed system.DNS (Domain Name System) works like looking up a phonebook: you know the other person's name (domain name) and need to find their phone number (IP address). But the internet's "phonebook" isn't a single book β€” it's a hierarchical, distributed system.

πŸ’‘ Tips PraktisπŸ’‘ Pro Tip

1. Browser Cache: Check the local cache first. If you've visited this domain before, use the cached IP directly 2. Recursive Resolver: If the cache misses, the request goes to the ISP's recursive resolver (like 8.8.8.8) 3. Hierarchical Query: The recursive resolver asks the root name server β†’ top-level domain server (.com) β†’ authoritative name server (google.com) in sequence 4. Return Result: The authoritative server returns the final IP, the recursive resolver caches the result and returns it to the browser1. Browser Cache: Check the local cache first. If you've visited this domain before, use the cached IP directly 2. Recursive Resolver: If the cache misses, the request goes to the ISP's recursive resolver (like 8.8.8.8) 3. Hierarchical Query: The recursive resolver asks the root name server β†’ top-level domain server (.com) β†’ authoritative name server (google.com) in sequence 4. Return Result: The authoritative server returns the final IP, the recursive resolver caches the result and returns it to the browser

LevelServerResponsibilityCount
RootRoot ServerKnows the addresses of all top-level domains13 groups globally
Top-level DomainTLD ServerManages .com, .cn, .org, etc.One group per suffix
AuthoritativeAuthoritativeStores DNS records for specific domainsAt least 2 per domain
Recursive ResolverResolverCompletes the entire query process on behalf of the userISP or public DNS

------

2. DNS Record Types: The "Configuration Table" Behind Domain Names2. DNS Record Types: The "Configuration Table" Behind Domain Names

DNS does more than just translate domain names to IPs. Through different types of DNS records, you can control email delivery, domain redirection, service discovery, and more. Understanding these record types is fundamental for configuring domain names and troubleshooting network issues.DNS does more than just translate domain names to IPs. Through different types of DNS records, you can control email delivery, domain redirection, service discovery, and more. Understanding these record types is fundamental for configuring domain names and troubleshooting network issues.

Record TypePurposeExample
ADomain β†’ IPv4 addressexample.com β†’ 93.184.216.34
AAAADomain β†’ IPv6 addressexample.com β†’ 2606:2800:220:1:...
CNAMEDomain β†’ another domain (alias)www.example.com β†’ example.com
MXSpecifies mail serverexample.com β†’ mail.example.com
TXTStores text informationSPF verification, domain ownership verification
NSSpecifies authoritative name serverexample.com β†’ ns1.example.com
πŸ’‘ Tips PraktisπŸ’‘ Pro Tip

- Deploying a website: Add an A record pointing to the server IP, or CNAME pointing to a CDN domain - Configuring email: Add MX records pointing to the mail server, TXT records for SPF/DKIM anti-spam - Verifying domain ownership: Cloud providers require you to add specific TXT records to prove you own the domain - Load balancing: Configure multiple A records for the same domain, DNS round-robin distributes traffic- Deploying a website: Add an A record pointing to the server IP, or CNAME pointing to a CDN domain - Configuring email: Add MX records pointing to the mail server, TXT records for SPF/DKIM anti-spam - Verifying domain ownership: Cloud providers require you to add specific TXT records to prove you own the domain - Load balancing: Configure multiple A records for the same domain, DNS round-robin distributes traffic

------

3. HTTPS and TLS: Putting "Body Armor" on Your Data3. HTTPS and TLS: Putting "Body Armor" on Your Data

HTTP protocol transmits data in plain text β€” like sending a postcard where the mailman (man-in-the-middle) can read the contents at will. HTTPS adds a layer of TLS (Transport Layer Security) encryption on top of HTTP, equivalent to putting the postcard in a sealed envelope.HTTP protocol transmits data in plain text β€” like sending a postcard where the mailman (man-in-the-middle) can read the contents at will. HTTPS adds a layer of TLS (Transport Layer Security) encryption on top of HTTP, equivalent to putting the postcard in a sealed envelope.

The TLS handshake is the critical step for establishing a secure connection. It completes identity verification and key negotiation before正式 transmitting data.The TLS handshake is the critical step for establishing a secure connection. It completes identity verification and key negotiation before正式 transmitting data.

πŸ’‘ Tips PraktisπŸ’‘ Pro Tip

1. Client Hello: The client sends a list of supported encryption algorithms and a random number 2. Server Hello: The server selects an encryption algorithm, returns the digital certificate and a random number 3. Certificate Verification: The client verifies whether the server's certificate is trustworthy (checks CA signature, validity period, domain match) 4. Key Exchange: Both parties negotiate a shared key through the ECDHE algorithm (the key itself is not transmitted over the network) 5. Encrypted Communication: All subsequent data is encrypted using the negotiated symmetric key1. Client Hello: The client sends a list of supported encryption algorithms and a random number 2. Server Hello: The server selects an encryption algorithm, returns the digital certificate and a random number 3. Certificate Verification: The client verifies whether the server's certificate is trustworthy (checks CA signature, validity period, domain match) 4. Key Exchange: Both parties negotiate a shared key through the ECDHE algorithm (the key itself is not transmitted over the network) 5. Encrypted Communication: All subsequent data is encrypted using the negotiated symmetric key

FeatureTLS 1.2TLS 1.3
Handshake round trips2-RTT1-RTT (first time) / 0-RTT (resumption)
Key exchangeRSA or ECDHEECDHE only (forward secrecy)
Cipher suitesSupports more legacy algorithmsOnly secure algorithms retained
PerformanceSlowerFaster

------

4. Certificate Trust Chain: Motivation for Trusting This Website4. Certificate Trust Chain: Motivation for Trusting This Website

The most critical step in the TLS handshake is "certificate verification." How does the browser determine whether a website's certificate is genuine and not forged by an attacker? The answer is the certificate trust chain β€” a system of endorsements at every level.The most critical step in the TLS handshake is "certificate verification." How does the browser determine whether a website's certificate is genuine and not forged by an attacker? The answer is the certificate trust chain β€” a system of endorsements at every level.

πŸ’‘ Tips PraktisπŸ’‘ Pro Tip

1. Root Certificate (Root CA): Issued by trusted certificate authorities, pre-installed in operating systems and browsers. This is the "anchor" of trust. 2. Intermediate Certificate (Intermediate CA): Issued by the root CA, used to issue end-entity certificates. Root CAs don't directly issue website certificates for security isolation. 3. End-entity Certificate (Leaf Certificate): The certificate your website actually uses, issued by the intermediate CA, containing the domain name, public key, validity period, and other information.1. Root Certificate (Root CA): Issued by trusted certificate authorities, pre-installed in operating systems and browsers. This is the "anchor" of trust. 2. Intermediate Certificate (Intermediate CA): Issued by the root CA, used to issue end-entity certificates. Root CAs don't directly issue website certificates for security isolation. 3. End-entity Certificate (Leaf Certificate): The certificate your website actually uses, issued by the intermediate CA, containing the domain name, public key, validity period, and other information.

Certificate TypeVerification LevelIssuance SpeedUse Case
DV (Domain Validation)Only verifies domain ownershipMinutesPersonal websites, blogs
OV (Organization Validation)Verifies organizational identityDaysCorporate websites
EV (Extended Validation)Strict identity verificationWeeksBanks, financial institutions
Wildcard CertificateCovers all subdomainsVaries by typeMulti-subdomain scenarios

------

5. HTTP vs HTTPS: Why Encryption Is the Baseline5. HTTP vs HTTPS: Why Encryption Is the Baseline

In 2024, over 95% of global web traffic was transmitted via HTTPS. Chrome marks HTTP websites with a "Not Secure" warning, and search engines lower the ranking of HTTP websites. HTTPS is no longer an "optional extra" β€” it's the baseline requirement for the modern web.In 2024, over 95% of global web traffic was transmitted via HTTPS. Chrome marks HTTP websites with a "Not Secure" warning, and search engines lower the ranking of HTTP websites. HTTPS is no longer an "optional extra" β€” it's the baseline requirement for the modern web.

DimensionHTTPHTTPS
Data transmissionPlain text, can be eavesdroppedEncrypted, cannot be eavesdropped
Identity verificationNone, cannot confirm server identityYes, server verified through certificates
Data integrityNo protection, can be tampered withProtected, tampering will be detected
Port80443
SEO impactLower search rankingSearch ranking boost
Browser displayShows "Not Secure" warningShows lock icon
πŸ’‘ Tips PraktisπŸ’‘ Pro Tip

Let's Encrypt is a free, automated certificate authority that enables any website to enable HTTPS at zero cost. Combined with the Certbot tool, you can apply for and auto-renew certificates with a single command. Most cloud platforms and CDN providers also offer free SSL certificates.Let's Encrypt is a free, automated certificate authority that enables any website to enable HTTPS at zero cost. Combined with the Certbot tool, you can apply for and auto-renew certificates with a single command. Most cloud platforms and CDN providers also offer free SSL certificates.

------

SummarySummary

Domain names, DNS, and HTTPS are the three pillars of internet infrastructure. DNS enables us to access websites using human-readable names, and HTTPS ensures the communication process is secure and trustworthy.Domain names, DNS, and HTTPS are the three pillars of internet infrastructure. DNS enables us to access websites using human-readable names, and HTTPS ensures the communication process is secure and trustworthy.

Key takeaways from this chapter:Key takeaways from this chapter:

  1. DNS is a hierarchical system: Root β†’ Top-level domain β†’ Authoritative, queried level by level, accelerated by cachingDNS is a hierarchical system: Root β†’ Top-level domain β†’ Authoritative, queried level by level, accelerated by caching
  2. Record types have different purposes: A records point to IPs, CNAME creates aliases, MX manages email, TXT handles verificationRecord types have different purposes: A records point to IPs, CNAME creates aliases, MX manages email, TXT handles verification
  3. TLS handshake establishes trust: Certificate verification + key negotiation, TLS 1.3 requires only 1-RTTTLS handshake establishes trust: Certificate verification + key negotiation, TLS 1.3 requires only 1-RTT
  4. Certificate trust chain: Root CA β†’ Intermediate CA β†’ Leaf certificate, endorsed at every levelCertificate trust chain: Root CA β†’ Intermediate CA β†’ Leaf certificate, endorsed at every level
  5. HTTPS is the baseline: Free certificates (Let's Encrypt) make encryption zero-barrierHTTPS is the baseline: Free certificates (Let's Encrypt) make encryption zero-barrier
  6. Further ReadingFurther Reading

    • [How DNS Works](https://howdns.works/) - A comic-style explanation of DNS[How DNS Works](https://howdns.works/) - A comic-style explanation of DNS
    • [Let's Encrypt Documentation](https://letsencrypt.org/docs/) - Free SSL certificate application guide[Let's Encrypt Documentation](https://letsencrypt.org/docs/) - Free SSL certificate application guide
    • [Cloudflare Learning Center](https://www.cloudflare.com/learning/dns/what-is-dns/) - DNS and network security tutorials[Cloudflare Learning Center](https://www.cloudflare.com/learning/dns/what-is-dns/) - DNS and network security tutorials
    • [TLS 1.3 RFC 8446](https://datatracker.ietf.org/doc/html/rfc8446) - TLS 1.3 protocol specification[TLS 1.3 RFC 8446](https://datatracker.ietf.org/doc/html/rfc8446) - TLS 1.3 protocol specification
    • [SSL Labs](https://www.ssllabs.com/ssltest/) - Online HTTPS configuration quality checker[SSL Labs](https://www.ssllabs.com/ssltest/) - Online HTTPS configuration quality checker