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.
When you type a URL in your browser, a multi-step resolution process happens in milliseconds:
/etc/hosts file.| Type | Name | Purpose | Example |
|---|---|---|---|
A | Address | Maps domain to IPv4 address | example.com → 93.184.216.34 |
AAAA | IPv6 Address | Maps domain to IPv6 address | example.com → 2606:2800:220:1:... |
CNAME | Canonical Name | Alias one domain to another | www.example.com → example.com |
MX | Mail Exchange | Directs email to mail servers | example.com → mail.example.com (pri 10) |
NS | Nameserver | Delegates DNS to nameservers | example.com → ns1.provider.com |
TXT | Text | Arbitrary text (SPF, DKIM, verification) | "v=spf1 include:_spf.google.com ~all" |
SRV | Service | Service location (e.g., SIP, XMPP) | _sip._tcp.example.com |
SOA | Start of Authority | Primary nameserver and zone info | Serial, refresh, retry, expire values |
CAA | Cert Authority Auth | Which CAs can issue SSL certs | 0 issue "letsencrypt.org" |
PTR | Pointer | Reverse DNS (IP to domain) | 34.216.184.93 → example.com |
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 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 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 store text strings and are used extensively for email security and domain verification:
# Allow Google and Mailgun to send email for your domain
"v=spf1 include:_spf.google.com include:mailgun.org ~all"
# DKIM public key for email signature verification
selector._domainkey.example.com. TXT "v=DKIM1; k=rsa; p=MIGfMA0GCS..."
# DMARC policy to protect against email spoofing
_dmarc.example.com. TXT "v=DMARC1; p=reject; rua=mailto:[email protected]"
# Google Search Console verification
"google-site-verification=abc123..."
# Let's Encrypt DNS challenge
_acme-challenge.example.com. TXT "gfj9Xq...Rg85nM"
# 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
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+.
www.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.
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.
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.
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