DNS records explained: A, AAAA, CNAME, MX, TXT, and NS
DNS is the address book of the internet: it turns names like example.com into the addresses and instructions machines need. Every domain has a set of records, and knowing what each type does turns DNS from magic into something you can debug.
The records you will actually use
A and AAAA point a name at an IP address. A records hold IPv4 addresses, AAAA records hold IPv6. When a browser visits your site, this is the lookup that happens first.
CNAME says "this name is an alias for that name." www.example.com is typically a CNAME pointing at example.com. Hosting platforms like Vercel and Netlify have you create CNAMEs pointing at their infrastructure, so they can change IPs without you updating anything.
MX records route email. They list the mail servers that accept messages for your domain, with priorities. No MX records means no email delivery.
TXT records hold arbitrary text, and modern infrastructure leans on them heavily: SPF records say which servers may send email as your domain, DKIM holds email signing keys, DMARC sets the policy for failures, and services like Google and GitHub use TXT records to verify you own a domain.
NS records name the authoritative nameservers for the domain, the servers that hold all the records above.
Debugging the classics
"I changed DNS and nothing happened." Every record has a TTL, the number of seconds resolvers may cache it. Until the old TTL expires, much of the internet still sees the old value. This is propagation delay, and there is no way to rush it. Before planned changes, lower the TTL a day in advance.
"Email from my domain goes to spam." Check the TXT records. Missing or wrong SPF, DKIM, or DMARC records are the usual cause. Mail providers publish exactly what these records should contain.
"My CNAME does not work at the domain root." That is by design: the DNS standard does not allow CNAMEs at the apex (example.com itself). Providers work around this with ALIAS or ANAME records, or by giving you A record IPs for the root.
You can check any of these records in seconds with the DNS Lookup tool, which queries public DNS over HTTPS and shows every record type for a domain.