DNS translates names to addresses. The conceptual model is simple; the operational reality is full of edge cases. DNS issues are a frequent source of production problems — slow lookups, stale caches, propagation delays, DNS-server failures.
This page covers the parts that matter for application engineers.
When a process needs to resolve example.com:
The recursive resolver does most of the heavy work. The stub on your machine is simple.
Common types:
For application code, A/AAAA is dominant. CNAME is common for "point to managed service" patterns (CloudFront distribution, ALB).
Every DNS response includes a TTL. Resolvers cache for that duration.
Common TTLs:
TTL trade-off:
When planning a change, lower the TTL well in advance (1 day before), make the change, raise the TTL after.
"DNS propagation" is the time for changes to be visible everywhere. Determined by:
You can lower TTL in advance to bound propagation. Once the new value is published, all caches expire within their TTL and pick up the new value.
The "DNS takes 24-48 hours to propagate" advice exists because:
For most modern setups with reasonable TTLs, propagation is minutes, not days.
Cloud providers offer managed DNS:
Features beyond basic resolution:
These are useful for managing global services without per-region client logic.
Common pattern: DNS returns multiple A records; clients pick one.
example.com → 10.0.0.1, 10.0.0.2, 10.0.0.3
Pros:
Cons:
For traffic distribution within a data center, dedicated load balancers are better. DNS load balancing is for cross-region or cross-data-center routing.
Application has cached IP that's no longer valid. Causes:
For long-running connections to a hostname that may move (managed databases, cloud services), build in periodic re-resolution.
DNS resolution is synchronous. A slow DNS server makes every connection slow.
In Java: InetAddress.getByName() blocks. Use a connection pool or async resolution.
If a hostname has both A and AAAA records, the application picks one. Some networks have broken IPv6; the application falls back to IPv4 after timeout. The fallback adds latency.
Modern apps use "happy eyeballs" — try both simultaneously, pick the first to succeed.
DNS responses are not authenticated by default. DNSSEC provides cryptographic signing. Adoption is partial; most public DNS doesn't use it. Server-to-server within infrastructure usually skips DNSSEC.
The DNS spec doesn't allow CNAME at the apex of a domain (example.com, not www.example.com). Some providers offer "ALIAS" or "ANAME" records that simulate this; behavior varies.
For services hosted at apex pointing to cloud-managed endpoints, this can be awkward.
dig, nslookup, etc.