How DNS Works

DNS (Domain Name System) is often called the "phonebook of the internet." It translates human-readable domain names like whatip.ca into machine-readable IP addresses like 192.0.2.1. Without DNS, you'd have to memorize IP addresses for every website you want to visit.

The DNS Resolution Process

When you type a URL into your browser, here's what happens behind the scenes:

Your Browser → DNS Resolver → Root Server → TLD Server → Authoritative Server → IP Address

Step 1: Browser Cache Check

Your browser first checks its own cache to see if it recently looked up this domain. If found, it uses the cached IP immediately.

Step 2: Operating System Cache

If not in browser cache, the request goes to your operating system, which also maintains a DNS cache.

Step 3: Recursive Resolver

If still not found, the query goes to a recursive DNS resolver — typically operated by your ISP or a public DNS service like Google (8.8.8.8) or Cloudflare (1.1.1.1).

Step 4: Root Name Servers

The resolver contacts one of the 13 root name server clusters. These don't know the final IP, but they know which servers handle each top-level domain (.com, .org, .ca, etc.).

Step 5: TLD Name Servers

The root server directs the resolver to the TLD (Top-Level Domain) server. For whatip.ca, this would be the .ca TLD servers.

Step 6: Authoritative Name Server

The TLD server points to the authoritative name server for the specific domain. This server has the actual DNS records and returns the IP address.

Step 7: Response & Caching

The IP address travels back through the chain. Each server caches the result for faster future lookups (based on the TTL — Time To Live).

lightbulb Speed Optimization

This entire process typically takes just 20-120 milliseconds. Caching at multiple levels means most queries are resolved without going through all steps.

Types of DNS Servers

Server Type Role Example
Recursive Resolver Does the lookup work on behalf of the client 8.8.8.8 (Google), 1.1.1.1 (Cloudflare)
Root Server Points to TLD servers a.root-servers.net
TLD Server Handles top-level domains .com, .org, .ca servers
Authoritative Server Has the actual DNS records Your domain's nameservers

Common DNS Record Types

Record Purpose Example
A Maps domain to IPv4 address whatip.ca → 192.0.2.1
AAAA Maps domain to IPv6 address whatip.ca → 2001:db8::1
CNAME Alias pointing to another domain www → whatip.ca
MX Mail server for the domain Priority 10: mail.example.com
TXT Text data (SPF, DKIM, verification) v=spf1 include:_spf.google.com ~all
NS Nameservers for the domain ns1.example.com

DNS Caching & TTL

Each DNS record has a TTL (Time To Live) value that tells resolvers how long to cache the record. Common TTL values:

warning Propagation Delays

When you change DNS records, the old records may persist in caches worldwide until their TTL expires. This is why DNS changes can take up to 48 hours to fully propagate.

Checking DNS Records

You can query DNS records using command-line tools:

# Using nslookup
nslookup whatip.ca

# Using dig (more detailed)
dig whatip.ca A
dig whatip.ca MX
dig whatip.ca TXT

# Query a specific DNS server
dig @8.8.8.8 whatip.ca

Or use our DNS lookup tool for a visual, easy-to-read output.

Check Any Domain's DNS Records

Use our free DNS lookup tool to see A, MX, TXT, and other records.

search DNS Lookup Tool