Skip to content
Optimal Lab

DevOps · interactive

DNS records

Your domain's zone is a small table of records: A and AAAA for addresses, CNAME for aliases, MX for mail, TXT for verification and email policy, NS for who's in charge. Run a few lookups against it.

nametypevalueTTL
example.comA93.184.216.34300
example.comAAAA2606:2800:220:1::248300
www.example.comCNAMEexample.com3600
api.example.comCNAMElb-123.eu-west-1.elb.amazonaws.com60
example.comMX10 mail.example.com3600
example.comTXTv=spf1 include:_spf.google.com -all3600
example.comNSns1.dnsprovider.net86400

$ dig www.example.com A

  1. www.example.com CNAME → example.com
  2. example.com A → 93.184.216.34

A CNAME says “ask about this other name instead”, so the lookup takes another step. Fine for subdomains; the bare domain can't be a CNAME.

Lookup

Step 2 of 4

  1. 1

    A, AAAA: names to addresses

    The basic answer: an IPv4 or IPv6 address. A name can have several for simple load spreading.

    dig +short example.com

  2. 2

    CNAME: follow another name

    Point www or api at a load balancer or CDN whose IPs change. Not allowed at the apex; providers offer ALIAS/ANAME instead.

    A CNAME can't coexist with other records on that name.

  3. 3

    MX and TXT

    MX says where mail goes. TXT carries SPF, DKIM, DMARC and domain-verification tokens.

    Missing SPF/DMARC sends your mail to spam.

  4. 4

    TTL decides how fast changes spread

    Resolvers cache answers for the TTL. Lower it a day before a migration, then raise it again.

    Manage zones as code (Terraform, OctoDNS).

In production

Tools and technologies

Every domain is managed through a zone like this.

Not tied to one language — use these names when you search docs or design a system.