Infrastructure
Registrar vs. DNS host
These are two separate roles, sometimes handled by the same company and sometimes not. The registrar (Route 53 domain registration, Namecheap, GoDaddy, etc.) is who you bought the domain from and who's on record with ICANN as the owner. The DNS host (Route 53 hosted zones, Cloudflare, the registrar's own DNS) is whoever actually answers DNS queries for the domain, based on which nameservers the registrar has set. It's entirely normal to buy a domain at one registrar and point its nameservers at a different provider's DNS.
Common record types
| Type | Points to | Typical use |
|---|---|---|
A | An IPv4 address | Pointing a domain directly at a server's IP — e.g. a Lightsail static IP. |
AAAA | An IPv6 address | The IPv6 equivalent of an A record. |
CNAME | Another hostname | Aliasing a subdomain to another domain name — can't be used on a zone apex (bare domain). |
ALIAS (Route 53 only) | An AWS resource (S3, CloudFront, an ELB) or another record | A Route 53-specific extension that behaves like a CNAME but is allowed at the zone apex — the standard way to point a bare domain at a load balancer or CloudFront distribution. |
MX | A mail server hostname, with a priority | Routing email for the domain to a mail provider (Google Workspace, etc.). Lower priority number wins. |
TXT | Arbitrary text | Domain ownership verification, SPF/DKIM/DMARC email authentication records. |
NS | Nameserver hostnames | Delegates a (sub)domain to a specific set of nameservers. |
Pointing a domain at a Lightsail/EC2 instance
Type: A
Name: @ (or blank, for the bare domain)
Value: STATIC_IP
TTL: 300
Type: A
Name: www
Value: STATIC_IP
TTL: 300
Using the instance's static/Elastic IP here matters — pointing an A record at a non-static IP works until the instance is next stopped and started, at which point the IP changes and the A record silently starts resolving to nothing.
TTL
TTL (time to live, in seconds) controls how long resolvers are allowed to cache a record before re-querying. A low TTL (60–300s) means changes propagate fast but generates more DNS query traffic; a high TTL (3600s+) is cheaper to serve but means a change takes longer to be seen everywhere. The common pattern: drop the TTL to something low (e.g. 60s) a day or two before a planned change, let that propagate, make the change, then raise the TTL back up once it's confirmed working.
Propagation and checking a change
"Propagation" is really just every resolver's cache expiring and re-querying on its own schedule — there's no single moment a change "goes live" everywhere at once. Bypass your local machine's cached/ISP resolver and query an authoritative or public resolver directly to check a change immediately:
dig example.com A +short
dig example.com A @8.8.8.8 +short # query Google's resolver directly
dig example.com NS +short # confirm which nameservers are authoritative
Email-related records
Most DNS problems people hit after the website works are about email. Three TXT records work together to prove that mail claiming to be from your domain really is:
| Record | Where it lives | What it does |
|---|---|---|
| SPF | TXT on the bare domain, starting v=spf1 | Lists the servers allowed to send mail for the domain. Only one SPF record is allowed per domain; a second one invalidates both. Use the SPF Checker to validate it and count DNS lookups (the limit is 10). |
| DKIM | TXT (or CNAME) at selector._domainkey | Publishes the public key used to verify the cryptographic signature your mail provider adds to each message. The selector name comes from the provider. |
| DMARC | TXT at _dmarc | Tells receivers what to do when SPF and DKIM fail (p=none, quarantine or reject) and where to send reports. Start with p=none and read the reports before tightening. |
Type: TXT Name: @ Value: "v=spf1 include:_spf.google.com ~all"
Type: TXT Name: _dmarc Value: "v=DMARC1; p=none; rua=mailto:dmarc@example.com"
Remember that an MX record only controls where incoming mail goes. Sending is governed by SPF, DKIM and DMARC, so you can have working inbound mail and still have outbound mail landing in spam.
Other record types worth knowing
CAArestricts which certificate authorities may issue certificates for the domain, e.g.0 issue "letsencrypt.org". Worth adding once you know which CA you use.SRVadvertises the host and port for a specific service, used by some chat, VoIP and directory services rather than websites.PTRis reverse DNS (IP to hostname). It's set by whoever owns the IP, not in your zone, and mail servers often check it, so set it on the provider's side if you run your own mail server.SOAis created automatically and holds the zone's serial number and default timers. You rarely edit it by hand.
Common mistakes
- CNAME at the bare domain. It isn't allowed because it would conflict with the NS, MX and SOA records that must also exist there. Use an A record, or an ALIAS/ANAME record if your provider supports one.
- CNAME alongside other records. A name with a CNAME can't have any other record type (such as MX or TXT) on the same name.
- Trailing dots and doubled domains. Some DNS panels expect the full name to end with a dot; others append the domain automatically. If a record ends up at
www.example.com.example.com, this is why. - Quotes and long TXT values. A TXT string is limited to 255 characters. Long DKIM keys must be split into several quoted strings, which most providers do for you.
- Editing the wrong zone. If the nameservers at the registrar point to Route 53 or Cloudflare, records added in the registrar's own DNS panel are simply ignored. Check with
dig NSfirst.
Troubleshooting with dig
dig example.com MX +short # where does mail go?
dig example.com TXT +short # SPF and verification records
dig _dmarc.example.com TXT +short # DMARC policy
dig example.com CAA +short # allowed certificate authorities
dig +trace example.com # follow delegation from the root servers
dig -x 203.0.113.10 +short # reverse lookup for an IP
If your local answer differs from what an authoritative nameserver returns, the cause is almost always caching. Query the nameserver listed by dig NS directly with dig example.com A @ns-123.awsdns-45.com to see the live value, then wait out the old record's TTL. On Windows, ipconfig /flushdns clears the local cache, which sometimes explains why one machine is behind another.
Route 53 specifics
A Route 53 hosted zone is the container for a domain's records, and creating one assigns four AWS nameservers — those need to be set at the registrar (even if the registrar is Route 53 itself) before Route 53's records take effect. Health checks and routing policies (weighted, latency-based, failover) go beyond simple A records for anything needing multi-region failover or traffic splitting, but for a single instance behind a single domain, a plain A or ALIAS record is all that's needed.