What Is DNS (Domain Name System)?
DNS (Domain Name System) is the system that translates human-readable domain names, such as example.com, into the numeric IP addresses that computers use to find each other. Every time you open a website or send an email, a DNS lookup happens first.
Why DNS exists
Computers locate each other with IP addresses like 192.0.2.10 (IPv4) or 2001:db8::1 (IPv6). People remember names far better than numbers. DNS bridges the two, and it is distributed across millions of servers so no single machine holds the whole directory.
How a DNS lookup works
When you visit www.example.com, your device asks a recursive resolver, usually run by your internet provider or a public service. If the resolver does not already have the answer cached, it walks the hierarchy:
- Root servers tell the resolver which servers handle the top-level domain, such as .com.
- TLD servers tell the resolver which nameservers are responsible for example.com.
- Authoritative nameservers hold the actual DNS records and return the IP address.
- The resolver returns the answer to your device and caches it for the duration of the record's TTL.
Caching is why repeat visits resolve almost instantly, and also why DNS changes are not seen everywhere at the same moment.
Common DNS record types
| Record | What it does | Example value |
|---|---|---|
| A | Maps a name to an IPv4 address | 192.0.2.10 |
| AAAA | Maps a name to an IPv6 address | 2001:db8::1 |
| CNAME | Makes one name an alias of another name | www points to example.com |
| MX | Says which servers receive email for the domain | 10 mail.example.com |
| TXT | Holds text, used for SPF, DKIM, DMARC and site verification | v=spf1 include:_spf.example.com ~all |
| NS | Lists the authoritative nameservers for the domain | ns1.example.net |
TTL and DNS propagation
TTL (time to live) is the number of seconds a resolver may cache a record. A TTL of 3600 means up to one hour. When you change a record, resolvers that cached the old value keep using it until the TTL expires. This delay is what people call DNS propagation.
Many changes are visible within minutes, but changing nameservers at the registrar can take up to 24 to 48 hours to settle everywhere. If you plan a migration, lower the TTL (for example to 300 seconds) a day or two in advance, then raise it again afterwards.
DNS and web hosting
DNS and web hosting are separate services. DNS tells browsers where your site lives, and web hosting is where it lives. When you move to a new host, you either update the A record to the new server's IP address or switch the domain to the new host's nameservers.
How to check DNS records
From a terminal you can query DNS directly:
dig example.com A +short
dig example.com MX +short
dig @8.8.8.8 example.com NS
nslookup example.com
Querying a specific public resolver, as in the third line, helps you compare what different parts of the internet currently see.
Frequently asked questions
What does DNS stand for?
DNS stands for Domain Name System. It is the global, distributed directory that translates domain names into IP addresses and other information, such as which servers handle a domain's email.
How long does DNS propagation take?
Record changes are often visible in a few minutes to a few hours, depending on the previous TTL. Changing a domain's nameservers can take up to 24 to 48 hours to be seen everywhere. Lowering the TTL before a planned change shortens the wait.
What is the difference between an A record and a CNAME record?
An A record points a name directly to an IPv4 address. A CNAME record points a name to another name, and the final IP address comes from that target. A CNAME cannot be placed on the root of a domain alongside other records, while an A record can.
What is a nameserver?
A nameserver is a DNS server that stores the records for a domain and answers queries about it. The NS records at your registrar tell the internet which nameservers are authoritative for your domain.
Why is my website not loading after I changed DNS?
Most often the old record is still cached by your device, your router or your internet provider's resolver. Wait for the TTL to expire, flush your local DNS cache, and verify the new value with dig or nslookup. Also confirm the new server is actually configured to serve your domain.
Is DNS the same as web hosting?
No. DNS only directs visitors to an IP address, while web hosting is the server at that address that stores and serves your website. You can buy them from different companies.
What is DNSSEC?
DNSSEC adds cryptographic signatures to DNS data so resolvers can verify that answers are authentic and were not tampered with. It protects against forged DNS responses but does not encrypt the queries themselves.
Related topics
- What Is Web Hosting? Hosting Basics
- 500 Internal Server Error: Causes and Fixes Errors & Troubleshooting
- What Is a Domain Name? Domains & DNS
- What Is an IP Address? Networking & IP
- IPv4 vs. IPv6 Networking & IP