DNS (DNS)
DNS is the phone book of the internet. When you type “google.com” into your browser, DNS looks up the actual address (a number like 142.250.80.46) so your computer knows where to send the request. Without DNS, you would need to memorize IP addresses for every website you visit.
The Domain Name System (DNS) is a hierarchical, distributed naming system defined in RFC 1034 and RFC 1035. It resolves fully qualified domain names (FQDNs) to IP addresses and provides other record types for mail routing, service discovery, and domain verification.
DNS operates primarily over UDP port 53 for standard queries (with a 512-byte limit for traditional DNS, extended to 4096 bytes via EDNS0) and TCP port 53 for zone transfers (AXFR/IXFR) and responses exceeding the UDP payload size.
The resolution process involves multiple server roles:
- Stub resolver: the client library on your OS that initiates queries
- Recursive resolver: performs the full lookup on behalf of the client, caching results per the record’s TTL
- Authoritative nameserver: holds the actual zone file with definitive records for a domain
Common record types:
- A / AAAA: IPv4 / IPv6 address mapping
- CNAME: canonical name alias
- MX: mail exchange servers with priority
- TXT: arbitrary text (SPF, DKIM, domain verification)
- NS: delegation to authoritative nameservers
- SOA: zone authority and serial number for replication
- SRV: service location (used by Active Directory, SIP, XMPP)
Modern extensions include DNS over HTTPS (DoH, RFC 8484), DNS over TLS (DoT, RFC 7858), and DNSSEC (RFC 4033) for cryptographic validation of responses.
dig query output
$ dig example.com A +short
93.184.216.34
$ dig example.com ANY +noall +answer
example.com. 86400 IN A 93.184.216.34
example.com. 86400 IN AAAA 2606:2800:220:1:248:1893:25c8:1946
example.com. 86400 IN MX 10 mail.example.com.
example.com. 86400 IN NS ns1.example.com.
example.com. 86400 IN NS ns2.example.com.
example.com. 86400 IN TXT "v=spf1 -all"
example.com. 86400 IN SOA ns1.example.com. admin.example.com. 2024010101 3600 900 604800 86400 DNS is involved in virtually every network connection. When a website goes down, DNS misconfiguration is one of the top three causes engineers check first (alongside certificate expiration and load balancer health). In enterprise environments, internal DNS (often Active Directory-integrated) maps hostnames to private IPs for service discovery. Split-horizon DNS serves different answers for internal vs. external queries to the same domain. DNS propagation delays after record changes (governed by TTL values) are a common source of “it works for me but not for you” scenarios during migrations. Tools like dig, nslookup, and dog are daily drivers for DNS troubleshooting.