What does an A record actually do?
The A record is defined in RFC 1035 as record type 1, and its RDATA is exactly four bytes — a raw IPv4 address. There is no port, no protocol, no weighting, and no notion of health. DNS hands the client an address; everything after that is the client's problem.
In a resolution, the A record is where the walk stops. A stub resolver asks a recursive resolver for www.example.com; the recursive resolver walks the root, the TLD servers, and the zone's authoritative nameservers (see the NS record reference), possibly following a CNAME or two along the way, and returns an address record. The answer section may contain the CNAME chain plus the final A record — that is normal, not a misconfiguration.
Because the A record is the endpoint, it is also the record most often wrong when a site is down but DNS "resolves fine". A stale A record pointing at a decommissioned server produces a connection timeout, not an NXDOMAIN — a distinction worth internalizing before you start debugging. If you are seeing NXDOMAIN instead, read SERVFAIL vs NXDOMAIN.
A record syntax and fields
| Field | Example | Meaning |
|---|---|---|
| Name (owner) | google.com. | The hostname being defined. In a zone file, @ means the zone apex and a bare label like www is relative to the zone origin. |
| TTL | 221 | Seconds a resolver may cache this answer. Inherited from $TTL if omitted in the zone file. |
| Class | IN | Internet class. Effectively always IN; CH and HS exist but you will never publish them. |
| Type | A | Record type 1 — IPv4 host address. |
| RDATA | 192.178.211.139 | One dotted-quad IPv4 address. Exactly one address per record. |
Multiple A records and round-robin
When a name has several A records, the authoritative server returns all of them in one RRset. Most nameservers rotate the order on each response — DNS round-robin — and most clients try the first address returned. The practical effect is coarse load spreading across servers, which is why the google.com answer above carries six addresses.
Round-robin is not load balancing, and treating it as such causes outages. Understand its limits:
- No health awareness. DNS does not know a server is down. If one of five A records points at a dead host, roughly one in five new connections stalls until the client's happy-eyeballs or retry logic kicks in — and some clients have none.
- Caching defeats the rotation. A resolver caches the whole RRset for the TTL and serves the same ordering it cached to everyone behind it. Distribution is per-resolver, not per-user.
- Client behaviour varies. Browsers implementing Happy Eyeballs (RFC 8305) race several addresses in parallel;
curland most command-line tools try them strictly in order with a connect timeout in between. - Removal is not instant. Pulling a bad address out still leaves it cached for up to the TTL. Plan for that window before you rely on record removal as a failover mechanism.
A records at the zone apex
The apex (example.com with no subdomain label) can hold A records but cannot hold a CNAME, because the apex must also carry SOA and NS records and a CNAME may not coexist with other data. That restriction is why apex hosting on a platform that only gives you a hostname is awkward, and why providers invented ALIAS, ANAME, and Cloudflare's CNAME flattening — all of which resolve the target server-side and hand out synthesized A records at query time.
If you are choosing between pointing at an IP and pointing at a name, CNAME vs A record walks the tradeoff. The short version: use an A record when you control the address and it is stable; use a CNAME on subdomains when a vendor owns the address and may change it.
What TTL should an A record use?
| Situation | Suggested TTL | Why |
|---|---|---|
| Stable production host | 3600–86400 | Fewer queries, better cache hit rate, resilience if your DNS provider has a bad day. |
| Before a planned migration | 300 (set 24–48h ahead) | Short TTL lets the cutover complete in minutes instead of a day. |
| Actively failing over | 60–300 | The floor on how fast a change can take effect. Below 60 many resolvers clamp anyway. |
| After a migration settles | Raise back to 3600+ | Leaving everything at 300 permanently multiplies your query volume for no benefit. |
The critical detail is that lowering a TTL only helps if you do it before the change — the old, long TTL is what is already cached. The full timeline is in Lower your TTL before a DNS migration.
Mistakes engineers actually make with A records
- Trailing-dot confusion in the host field. Provider forms want the label (
wwwor@), not the FQDN. Enteringwww.example.comin a Namecheap or cPanel host field usually yieldswww.example.com.example.com. - Leaving an old A record alongside a new one. Adding the new IP without deleting the old one gives you round-robin between working and broken — an intermittent outage that looks like "it works for some people".
- Publishing an RFC 1918 address publicly.
10.x,172.16–31.x, and192.168.xin a public zone means external clients connect to their own LAN. Split-horizon DNS exists for this; a public A record does not. - Confusing the browser cache with the resolver cache. Chrome and Firefox keep their own short DNS caches, and the OS keeps another. A dig from the shell can be correct while the browser is still wrong. See DNS_PROBE_FINISHED_NXDOMAIN.
- Assuming the CDN's A record is yours to hardcode. CDN edge addresses rotate. If a vendor gave you a hostname, use a CNAME on a subdomain rather than pinning today's IP into an A record.
- Forgetting the AAAA record. A dual-stack client with a working IPv6 path prefers the AAAA record. A stale AAAA alongside a fresh A produces failures only for IPv6 users.
Check it with dig
# Just the addresses
dig +short google.com A
# Full answer with TTLs, so you can see caching in action
dig +noall +answer google.com A
# Ask the authoritative server directly, bypassing every cache
dig +noall +answer @ns1.google.com google.com A
# Follow the whole delegation path from the root
dig +trace google.com A
# Compare two public resolvers
dig +short @8.8.8.8 google.com A
dig +short @1.1.1.1 google.com AIf two resolvers disagree, the record changed recently and one of them is still serving a cached copy. Confirm with DNS Compare or check all 85 resolvers on the propagation checker. For a whole-zone view, DNS Lookup returns every record type at once.