DNS Explained: A Complete Technical Guide

Understand how DNS works, learn about record types, nameservers, propagation, and common configuration tasks.

What is DNS?

DNS (Domain Name System) is the internet's phone book. It translates human-readable domain names like "example.com" into IP addresses like "93.184.216.34" that computers use to communicate. Without DNS, you would need to memorize IP addresses for every website you visit.

When you type a domain name into your browser, a series of DNS lookups happen in milliseconds: your device checks its local cache, then queries a recursive resolver (usually your ISP), which queries root nameservers, TLD nameservers, and finally the authoritative nameserver for the domain.

Essential DNS record types

A Record: Maps a domain name to an IPv4 address (e.g., example.com → 93.184.216.34). This is the most fundamental DNS record and is required for any website.

AAAA Record: Maps a domain to an IPv6 address. As IPv4 addresses become scarce, IPv6 adoption is growing. Supporting both A and AAAA records ensures your site is accessible on modern networks.

CNAME Record: Creates an alias from one domain to another (e.g., www.example.com → example.com). Useful for subdomains and CDN configurations. Cannot be used at the zone apex (root domain).

MX Record: Specifies mail servers for your domain. Priority values determine the order in which mail servers are tried. Lower numbers indicate higher priority. Essential for receiving email at your domain.

TXT Record: Stores arbitrary text data. Commonly used for email authentication (SPF, DKIM, DMARC), domain verification (Google Search Console, SSL certificates), and other service integrations.

NS Record: Specifies the authoritative nameservers for your domain. These are set at your registrar and tell the internet which DNS servers hold the records for your domain.

Nameservers and DNS hosting

Nameservers are the servers that store and serve your DNS records. When you register a domain, your registrar provides default nameservers, but you can point to third-party DNS providers like Cloudflare, AWS Route 53, or Google Cloud DNS for better performance and features.

Premium DNS providers offer benefits like faster global resolution times, DDoS protection, advanced routing (geo-based, latency-based, weighted), and better uptime guarantees. For business-critical domains, using a dedicated DNS provider is recommended.

DNS propagation

When you change DNS records, the updates do not take effect instantly worldwide. DNS propagation is the time it takes for changes to spread across all DNS servers globally. This typically takes 15 minutes to 48 hours, depending on TTL (Time to Live) values and caching behavior.

TTL values (measured in seconds) control how long DNS resolvers cache a record before checking for updates. Lower TTL values (300 seconds = 5 minutes) mean faster propagation but more DNS queries. Higher values (86400 seconds = 24 hours) reduce query load but slow down changes.

Before making critical DNS changes (like migrating hosting providers), lower your TTL values 24-48 hours in advance. After the migration is complete and verified, you can raise TTL values back to normal.

Common DNS configurations

Connecting to web hosting: Create an A record pointing your domain to your hosting provider's IP address. Add a CNAME record for "www" pointing to your root domain. Most hosting providers provide specific instructions for their setup.

Setting up email: Add MX records pointing to your email provider (Gmail, Outlook, Fastmail, etc.). Add SPF, DKIM, and DMARC TXT records to authenticate your email and prevent spoofing. These records are critical for email deliverability.

Using a CDN: If using Cloudflare, change your nameservers to Cloudflare's. For other CDNs like AWS CloudFront or Fastly, add CNAME records pointing your domain to the CDN endpoint.

SSL certificate verification: Many SSL providers require you to add a CNAME or TXT record to verify domain ownership before issuing a certificate. Let's Encrypt uses HTTP or DNS challenges for automated verification.

Troubleshooting DNS issues

Use command-line tools like "dig" (Linux/Mac) or "nslookup" (Windows) to query DNS records directly. Online tools like DNS Checker, MXToolbox, and WhatsMyDNS show how your records resolve from different locations worldwide.

Common issues include: records not propagated yet (wait and check TTL), incorrect record values (double-check IP addresses and hostnames), conflicting records (remove duplicate or contradictory entries), and nameserver misconfiguration (verify NS records at your registrar match your DNS provider).

Continue exploring

Jump back into the core tools.

Back to Learn