← All technical notes

Networks / Field notes

DNS and network reliability

Published

DNS maps names to records. A successful lookup is necessary for most web requests, but it is not a test of routing, TLS or the application behind an address.

Understand the lookup path

A system resolver may consult a hosts file, local cache or recursive resolver. A recursive resolver retrieves records from the DNS hierarchy and caches results according to their TTL. Authoritative servers publish records for the zone. These layers can return different answers during a migration.

Application
Local resolver
Recursive DNS
Authoritative DNS
Typical lookup path on a cache miss; cached answers may bypass later steps.

A and AAAA records

An A record identifies an IPv4 address, while an AAAA record identifies an IPv6 address. Publish both only when the service is reachable on both address families. An unexpected AAAA record can produce failures on some clients even when IPv4 works correctly.

Before a planned migration, reduce the TTL sufficiently in advance for older cached records to expire. Once the new endpoint is verified, update the record and allow cached answers to age out. Keep the old endpoint available during the transition if practical.

Test a destination without changing DNS

For a server you control, curl’s resolve option directs a request to a specified address while preserving the HTTP hostname and TLS server name. This helps isolate DNS from connectivity and certificate problems. The address below is reserved for documentation and must be replaced with your server’s address.

getent ahosts example.com
resolvectl query example.com
curl -v --resolve example.com:443:192.0.2.10 https://example.com/

Interpret the result

A successful forced-address request and a failed ordinary request suggest that resolution or address selection deserves attention. If both fail, inspect the connection and application layers. Compare results from independent networks, and avoid treating a single successful probe as evidence that all clients can reach the service.

Change one variable at a time: resolver, destination address, client network or application configuration.

Further reading