Understanding DNS: A Complete Beginner’s Guide to How Domain Names Work
Every time you type a website address into your browser, an invisible system called DNS translates that human-readable name into a numerical IP address that computers use to find each other on the internet. DNS — the Domain Name System — is one of the most fundamental technologies that makes the web work, yet most website owners only encounter it when something breaks.
This guide explains how DNS works in plain language, what the different record types mean, and how to troubleshoot the most common DNS problems.
How DNS Works: The Basic Process
Think of DNS as the internet’s phone book. When you type example.com into your browser, your computer does not know where that website lives. It needs an IP address — something like 93.184.216.34 — to actually connect to the server. DNS is the system that looks up the IP address associated with the domain name.
The process happens in milliseconds and involves several steps. Your browser first checks its own cache to see if it recently looked up this domain. If not, it asks your operating system, which checks its cache. If still not found, the request goes to your internet provider’s DNS resolver. The resolver queries a series of authoritative DNS servers — starting from the root servers, to the TLD (top-level domain) servers, and finally to the domain’s own nameservers — until it gets the answer. The IP address is then returned to your browser, cached for future use, and the browser connects to the web server.
This entire lookup happens every time you visit a website, but caching means most lookups are resolved instantly from stored results.
DNS Record Types Explained
A Record (Address Record)
The most fundamental DNS record. An A record maps a domain name to an IPv4 address. When you point your domain to a hosting server, you are creating an A record. For example, an A record for example.com might point to 93.184.216.34. You can have multiple A records for the same domain, which is used for load balancing across multiple servers.
AAAA Record
The same as an A record but for IPv6 addresses. As the internet gradually transitions from IPv4 to IPv6, having an AAAA record alongside your A record ensures your site is accessible on both address formats.
CNAME Record (Canonical Name)
A CNAME record creates an alias that points one domain name to another domain name (not an IP address). This is commonly used to make www.example.com point to example.com, or to point a subdomain to a third-party service. For instance, you might create a CNAME record for blog.example.com that points to your-blog.wordpress.com.
Important: a CNAME cannot coexist with other record types on the same name. You cannot have a CNAME and an MX record on the same subdomain.
MX Record (Mail Exchange)
MX records tell the internet where to deliver email for your domain. If you use Google Workspace for email, your MX records point to Google’s mail servers. If you use Microsoft 365, they point to Microsoft’s servers. Each MX record has a priority number — lower numbers have higher priority, allowing you to set up backup mail servers that receive email if the primary server is unavailable.
TXT Record
TXT records store arbitrary text data in your DNS. They are used for domain verification (proving you own a domain to Google, Microsoft, or other services), email authentication (SPF, DKIM, and DMARC records are all TXT records), and various other verification purposes. When Google Search Console asks you to verify ownership by adding a DNS record, it is asking you to create a TXT record.
NS Record (Name Server)
NS records specify which DNS servers are authoritative for your domain — meaning which servers hold the official DNS records. When you change nameservers at your domain registrar, you are updating the NS records at the registry level.
Nameservers vs. DNS Records
This distinction confuses many website owners. Your domain registrar (where you bought the domain) lets you set nameservers. Your DNS host (which might be your registrar, your hosting provider, or a service like Cloudflare) is where you create individual DNS records.
When you point nameservers to your hosting provider, you are telling the internet “this hosting provider manages all DNS records for my domain.” You then create A records, MX records, and other records at your hosting provider’s DNS management panel. When you use Cloudflare’s nameservers, Cloudflare manages your DNS records, and you configure everything in Cloudflare’s dashboard.
TTL: Time to Live
Every DNS record has a TTL value measured in seconds. TTL tells DNS resolvers and caches how long to store the record before checking for updates. A TTL of 3600 means caches hold the record for one hour. A TTL of 86400 means one day.
Lower TTL values mean changes propagate faster but generate more DNS queries. Higher TTL values mean fewer queries but slower propagation when you make changes. For stable records that rarely change, a TTL of 3600 to 86400 is typical. Before making DNS changes (like migrating hosts), lower the TTL to 300 seconds at least 24 hours in advance so the change takes effect quickly.
DNS Propagation
When you change a DNS record, the update does not reach every DNS server on the internet instantly. Caches around the world still hold the old record until their cached copy expires (based on the TTL). This gradual update process is called DNS propagation.
Propagation typically takes anywhere from a few minutes to 48 hours, depending on TTL settings and how different DNS resolvers handle caching. During propagation, some visitors will reach your old server and others will reach your new one. This is why keeping both servers running during a migration is essential.
Common DNS Problems and Solutions
Site Shows Hosting Provider’s Default Page
This usually means your A record is not set correctly, or DNS changes have not propagated yet. Verify your A record points to the correct IP address and wait for propagation. Use a DNS lookup tool to check what IP address your domain currently resolves to.
Email Not Working After Changing Hosting
If you changed nameservers to a new host, your MX records might have been reset to default values. Check your MX records at the new DNS host and reconfigure them to point to your email provider’s mail servers.
SSL Certificate Errors
If you see certificate errors after a DNS change, your SSL certificate might not be configured on the new server, or the certificate was issued for a different IP address. Reissue or reinstall the SSL certificate after DNS changes are complete.
www Works but Non-www Does Not (or Vice Versa)
You likely have an A record for one version but not the other. Create an A record for both example.com and www.example.com, or use a CNAME for www that points to the bare domain. Then configure your web server to redirect one version to the other for consistency.
Tools for DNS Troubleshooting
Several free tools help you inspect and troubleshoot DNS. DNS Checker shows how your domain resolves from different locations worldwide. MXToolbox provides detailed analysis of your MX, SPF, and DKIM records. The dig and nslookup command-line tools (available on macOS and Linux, and through PowerShell on Windows) let you query specific DNS servers and inspect individual records in detail.
Understanding DNS gives you control over one of the most critical pieces of your web infrastructure. When you know what each record does and how changes propagate, domain-related problems become straightforward to diagnose and fix rather than mysterious black boxes you need to escalate to support.