DNS & Naming

a DNS resource record

DNS stores more than just name-to-address pairs, and each fact it keeps is packaged as a resource record — one labeled entry in the database. Think of each record as a single line in an index card for a name: a line saying its IPv4 address, another saying its mail server, another saying who is authoritative for it. A resource record is the basic unit of DNS data, and a zone is essentially a pile of them.

Each record has a name (which name it is about), a type (what kind of fact), a TTL (how long it may be cached), and the data itself. The common types are worth knowing: an A record maps a name to an IPv4 address (like 93.184.216.34); an AAAA record maps a name to an IPv6 address; a CNAME makes one name an alias for another (www.example.com is really an alias for example.com); an MX record names the mail server that should receive email for the domain; an NS record names the authoritative name servers for a zone (this is how delegation is recorded); a TXT record holds arbitrary text, widely used for verification and email anti-spoofing policies; and an SOA record sits at the top of every zone with administrative settings like its serial number and timers.

Why it matters: these record types are the actual vocabulary of DNS — when you configure a domain, you are adding and editing resource records, and almost every networked feature (web, email, certificates, anti-spam) depends on getting the right ones in place. A subtle gotcha to remember: a CNAME cannot coexist with most other records at the same name, and you generally cannot put a CNAME at a zone's apex (the bare example.com), which is why providers offer workarounds for pointing a root domain at a service.

A small zone might contain: an A record example.com -> 93.184.216.34; a CNAME www.example.com -> example.com; an MX record routing mail to mail.example.com; and an NS record naming ns1.example.com as authoritative. Each line is one resource record.

Different record types store different facts about the same name.

A CNAME is an alias to a name, not to an address, and it usually cannot sit alongside other records at the same name. So you generally cannot put a CNAME at the zone apex (bare example.com), which also needs SOA and NS records.

Also called
resource recordRRDNS record資源記錄DNS 記錄