DNS record types explained: A, AAAA, MX and more
A domain’s DNS zone is a list of records, and each type answers a different question: where the website lives, which server accepts mail, who is authoritative for the zone. Every record has a name, a type, a value and a time to live (TTL) that tells caches how long they may keep it. Because the types are independent, one domain can carry several records for separate purposes.
A, AAAA and CNAME: where a name points
An A record maps a name to an IPv4 address, and AAAA maps it to an IPv6 address. A CNAME record makes a name an alias for another name, so the address is looked up under that other name.
Under the DNS rules a CNAME generally cannot coexist with other data for the same name, so check your DNS provider’s requirements before adding one. Two more cautions apply. An A record does not prove that a web server works, and the absence of an A record does not rule out access over IPv6. Publish an AAAA only when the service really responds on IPv6, because clients that prefer IPv6 will try that address.
MX: which server receives mail
An MX record names a mail exchanger and gives it a preference number. Sending servers normally try the smallest number first. The exchanger’s name must resolve to an A or AAAA address; it does not need both.
When a domain has no MX at all, SMTP defines an implicit fallback: the sender tries the domain’s own A or AAAA address if one exists. RFC 5321 describes this behaviour.
NS and SOA: who answers for the zone
An NS record identifies the authoritative nameservers for a zone, or for a part of it that is delegated to someone else. The SOA record holds the key parameters of the zone, including a serial number that should increase whenever the zone changes and several timing values.
TXT, PTR and SRV
A TXT record stores text. It is often used for an SPF policy, which lists the servers allowed to send mail for the domain, or as proof that you control the domain. DKIM and DMARC also live in DNS, but they solve different authentication tasks, and one TXT record does not replace setting each of them up fully.
A PTR record supports the reverse mapping, from an address to a name. IPv4 uses the in-addr.arpa zone for this and IPv6 uses ip6.arpa. The owner or operator of the address block usually controls that reverse zone, so editing your ordinary domain’s DNS panel may not be enough to change it.
An SRV record tells clients which host and port provide a specific service. Its presence does not guarantee that the service is healthy.
Moving a website without breaking mail
Suppose example.com has A and AAAA records for the website, MX points to a separate mail host and www.example.com is an alias. Moving the website means changing the address records only. The MX records should stay exactly as they were.
If you want cached answers to expire sooner, lower the TTL in advance, before the change and not together with it. After changing the addresses, compare the answers from the authoritative servers with those from recursive resolvers, the servers that look names up on behalf of users. Not everyone sees the change at the same moment, because applications and resolvers keep cached data.
If mail fails, inspect the MX record and the addresses its target resolves to. If the website fails, check the relevant A or AAAA answer and then test the service itself. The core DNS record format is specified in RFC 1035.