Spunk Autos

Websites and web tools

Everything you need to know about DNS lookup

Every visit to a shop's website and every email to its inbox starts with a DNS lookup. This page explains the lookup chain, the record types a small business domain uses, the commands to inspect them, and how time to live (TTL) shapes a safe migration.

How a lookup travels

  1. Your device asks a recursive resolver, usually run by your network or a public resolver you chose.
  2. If the resolver has a fresh cached answer, it replies at once.
  3. If not, it asks a root server which servers handle the top-level domain, such as .autos or .com.
  4. The top-level domain servers point to the authoritative name servers for the domain.
  5. The authoritative server returns the record, and the resolver caches it for the record's TTL.

Record types you will meet

TypePurposeExample use
AMaps a name to an IPv4 addressThe web host for the site
AAAAMaps a name to an IPv6 addressSame host over IPv6
CNAMEMakes one name an alias of anotherwww pointing at a hosting platform
MXNames the mail servers and their priorityWhere customer emails go
TXTFree text, used for verification and mail policySPF, DKIM and DMARC entries
NSNames the authoritative serversSet at the registrar
CAALimits which certificate authorities may issue certificatesLock HTTPS certificates to your provider
SOAZone metadata and serial numberRead by secondary servers

A CNAME cannot sit at the bare domain alongside other records under the standard, which is why many DNS hosts offer a flattening or alias feature for the apex.

Commands to run

  • dig example.com A shows the IPv4 answer and its remaining TTL.
  • dig example.com MX +short lists mail servers only.
  • dig @1.1.1.1 example.com asks a specific resolver, useful to compare caches.
  • dig +trace example.com walks from the root down, showing each step.
  • nslookup -type=TXT example.com works on systems without dig.

TTL and a safe site move

TTL is the number of seconds a resolver may keep an answer. A value of 3600 means one hour; 86400 means 24 hours. When you move a site to a new host, resolvers that cached the old address keep using it until their copy expires.

Troubleshooting checklist

  • Site works for some people only: compare answers from two resolvers; one may hold a stale cache.
  • Email bouncing after a host change: check that MX records survived the move.
  • New subdomain missing: confirm you edited the zone at the provider that the NS records name.
  • Certificate errors after adding CAA: make sure your certificate provider is listed.
  • Changes not visible: remember negative answers are cached too, for a time set in the SOA record.

Keep a plain text copy of your zone before any change. If something breaks, you can put the old values back in minutes instead of guessing.