DNS turns names into the data clients need. The records you will touch as a DevOps engineer:
| Type | Points to | Example use |
|---|---|---|
| A | IPv4 address | api.shop.com → 203.0.113.10 |
| AAAA | IPv6 address | same, for IPv6 |
| CNAME | another name (alias) | www → shop-lb.cloudprovider.net |
| MX | mail servers, with priority | where email for the domain goes |
| TXT | free text | domain verification, SPF, DKIM |
| NS | the zone's name servers | delegating a domain or subdomain |
| PTR | name for an IP (reverse DNS) | mail server reputation, logs |
Every record has a TTL in seconds: how long resolvers may cache it. A resolver that cached a record with TTL 3600 can keep answering with it for up to an hour after you change it. Before a migration, lower the TTL a day ahead (say to 60), switch, then raise it again.
CNAME traps:
- A name with a CNAME cannot have any other record. The zone apex (
shop.comitself) must have NS and SOA records, so it cannot be a CNAME. Providers offer ALIAS/ANAME or "flattening" for that. - A CNAME adds a lookup step: the resolver follows it to the target's A record.
;; ANSWER SECTION:
www.shop.com. 300 IN CNAME shop-lb.cloud.example.
shop-lb.cloud.example. 60 IN A 203.0.113.10In interviews: "You updated a DNS record and some users still hit the old server. Why?" Caching until the old TTL expires.