DNS Lookup Guide: Record Types, How DNS Works & Troubleshooting

Updated March 2026 · 8 min read

The Domain Name System (DNS) is often called the "phone book of the internet." It translates human-readable domain names like devtoolkit.ink into IP addresses that computers use to communicate. Understanding DNS is critical for web development, server administration, email configuration, and troubleshooting connectivity issues.

How DNS Works: Step by Step

When you type a URL in your browser, a multi-step resolution process happens in milliseconds:

  1. Browser cache — checks if the domain was recently resolved.
  2. OS cache — checks the operating system's DNS cache and /etc/hosts file.
  3. Recursive resolver — your ISP's DNS server (or 8.8.8.8 / 1.1.1.1) handles the lookup.
  4. Root nameserver — directs the resolver to the appropriate TLD server (.com, .org, .ink).
  5. TLD nameserver — directs to the domain's authoritative nameserver.
  6. Authoritative nameserver — returns the actual DNS records for the domain.
  7. Response cached — the result is cached at each level according to the TTL.

DNS Record Types Explained

TypeNamePurposeExample
AAddressMaps domain to IPv4 addressexample.com → 93.184.216.34
AAAAIPv6 AddressMaps domain to IPv6 addressexample.com → 2606:2800:220:1:...
CNAMECanonical NameAlias one domain to anotherwww.example.com → example.com
MXMail ExchangeDirects email to mail serversexample.com → mail.example.com (pri 10)
NSNameserverDelegates DNS to nameserversexample.com → ns1.provider.com
TXTTextArbitrary text (SPF, DKIM, verification)"v=spf1 include:_spf.google.com ~all"
SRVServiceService location (e.g., SIP, XMPP)_sip._tcp.example.com
SOAStart of AuthorityPrimary nameserver and zone infoSerial, refresh, retry, expire values
CAACert Authority AuthWhich CAs can issue SSL certs0 issue "letsencrypt.org"
PTRPointerReverse DNS (IP to domain)34.216.184.93 → example.com

A Records: The Foundation

A records are the most fundamental DNS records. They point your domain to a server's IPv4 address:

# A record examples
devtoolkit.ink.     A    157.90.123.45
www.devtoolkit.ink. A    157.90.123.45

# Using dig to query A records
dig devtoolkit.ink A +short
# 157.90.123.45

# Using nslookup
nslookup devtoolkit.ink
# Address: 157.90.123.45

CNAME Records: Domain Aliases

CNAME records create an alias from one domain to another. They are commonly used for subdomains and CDN setups:

# CNAME examples
www.example.com.     CNAME  example.com.
blog.example.com.    CNAME  hosting-provider.com.
cdn.example.com.     CNAME  d111111abcdef8.cloudfront.net.

Important: You cannot set a CNAME on the root domain (apex). Use an A record or ALIAS/ANAME record (if your DNS provider supports it) for the root domain.

MX Records: Email Routing

MX records tell the world which servers handle email for your domain. The priority number determines the order — lower numbers are tried first:

# Google Workspace MX records
example.com.  MX  1   aspmx.l.google.com.
example.com.  MX  5   alt1.aspmx.l.google.com.
example.com.  MX  5   alt2.aspmx.l.google.com.
example.com.  MX  10  alt3.aspmx.l.google.com.
example.com.  MX  10  alt4.aspmx.l.google.com.

# Microsoft 365 MX record
example.com.  MX  0   example-com.mail.protection.outlook.com.

TXT Records: Verification and Security

TXT records store text strings and are used extensively for email security and domain verification:

SPF (Sender Policy Framework)

# Allow Google and Mailgun to send email for your domain
"v=spf1 include:_spf.google.com include:mailgun.org ~all"

DKIM (DomainKeys Identified Mail)

# DKIM public key for email signature verification
selector._domainkey.example.com. TXT "v=DKIM1; k=rsa; p=MIGfMA0GCS..."

DMARC

# DMARC policy to protect against email spoofing
_dmarc.example.com. TXT "v=DMARC1; p=reject; rua=mailto:[email protected]"

Domain Verification

# Google Search Console verification
"google-site-verification=abc123..."

# Let's Encrypt DNS challenge
_acme-challenge.example.com. TXT "gfj9Xq...Rg85nM"

DNS Troubleshooting Commands

# Query specific record types
dig example.com A
dig example.com MX
dig example.com TXT
dig example.com NS

# Query a specific DNS server
dig @8.8.8.8 example.com A

# Trace the full resolution path
dig +trace example.com

# Check all records
dig example.com ANY

# Reverse DNS lookup
dig -x 93.184.216.34

# Check propagation status
dig @8.8.8.8 example.com A +short     # Google DNS
dig @1.1.1.1 example.com A +short     # Cloudflare DNS
dig @9.9.9.9 example.com A +short     # Quad9 DNS

DNS Propagation

When you change DNS records, the update does not happen instantly. Old records are cached by resolvers worldwide according to the TTL (Time To Live) value. Propagation typically takes:

Pro tip: Before a planned migration, lower the TTL to 300 seconds a day in advance. After migration, verify with the DNS Lookup tool, then raise the TTL back to 3600+.

Common DNS Issues

FAQ

How long does DNS propagation take?

Most changes propagate within 1-2 hours. However, some ISPs cache aggressively, so full global propagation can take up to 48 hours. Lower your TTL before making changes to speed this up.

Can I have both A and CNAME records for the same subdomain?

No. CNAME records cannot coexist with other record types for the same name (except DNSSEC-related records). This is why you cannot CNAME the root domain if you also need MX or TXT records there.

What is the difference between a DNS registrar and DNS hosting?

The registrar is where you purchase and register the domain. DNS hosting is the service that stores and serves your DNS records. They can be different providers — you just point your registrar's NS records to your DNS host.

Should I use Cloudflare, Route 53, or my registrar's DNS?

For most projects, Cloudflare (free tier) offers excellent performance and DDoS protection. AWS Route 53 is ideal if you are already in the AWS ecosystem. Registrar DNS works but is often slower and less feature-rich.

Try DNS Lookup Now →

DevToolKit — 42+ Free Online Developer Tools