A DNS server is a computer that translates human-readable domain names, such as example.com, into the IP addresses browsers need to reach a website. When you type a domain, your device asks a recursive resolver, which checks its cache and then queries root, top-level domain and authoritative servers in turn until it gets the final IP address.
Key takeaways
- A DNS server translates domain names into IP addresses; without it you would need to memorise numbers for every site.
- A lookup usually passes through four server types: recursive resolver, root, TLD and authoritative nameserver.
- Your DNS choice affects speed, privacy and security, so pick a resolver that supports encrypted DNS and, if you want it, malware blocking.
You type a short, memorable name into your browser and the page appears. Behind that simple moment sits a DNS server, quietly turning the name into a number your computer can actually use.
What is a DNS server?
A DNS server is a computer that translates human-readable domain names into IP addresses. When you type example.com, it returns the address, such as 192.168.1.1, that your browser needs to reach that site.
DNS stands for Domain Name System. Cloudflare calls it the phone book of the internet: humans use names, browsers use IP addresses, and DNS bridges the two. Without it, you would need to memorise a string of numbers for every website you visit, including the longer IPv6 addresses used by modern networks.
A DNS server is software that serves DNS requests for clients. It can hold the official records for a domain, answer from a cache of earlier lookups, or pass the question on to other servers until it finds the answer. Different servers do different jobs in that chain, which is why one lookup can involve four server types.
Your device is usually configured with a DNS server automatically, often run by your internet provider. You can change it in your operating system, browser or router settings, and the change takes a few minutes.
How does DNS work?
DNS works by walking a hierarchy, from right to left in the domain name, until it reaches the server that holds the final answer. The whole journey usually takes milliseconds.
Cloudflare describes the lookup in eight steps when nothing is cached. First, you type example.com and the query goes to a DNS recursive resolver. The resolver queries a root nameserver, which points it to the .com top-level domain server.
That server points it to the nameserver for example.com, which returns the IP address. The resolver passes the answer back to your browser, and the browser then requests the page from that address.
Caching short-circuits much of this. Your browser, your operating system and the resolver all keep recent answers for a set time, called the time-to-live or TTL. When an answer is cached, steps are skipped and the lookup is faster.
There are three query types in a typical lookup. A recursive query asks the resolver for the final answer or an error. An iterative query lets a server return the best referral it has. A non-recursive query happens when the server already holds the answer or has it cached.
What are the types of DNS servers?
There are four main types: recursive resolvers, root nameservers, TLD nameservers and authoritative nameservers. Each answers a different part of the question.
Recursive resolver. This is the first server your computer contacts, usually run by your ISP or a public provider such as Google or Cloudflare. It acts as an intermediary and does the legwork on your browser's behalf, chasing the answer through the other servers. It also caches answers.
Root nameserver. The root is the highest level of the hierarchy. It does not know the IP address for a domain, but it knows which TLD server handles the ending, such as .com, and points the resolver there.
TLD nameserver. This server manages all domains under one top-level domain. It points the resolver to the authoritative nameserver for the specific domain being asked about.
Authoritative nameserver. This is the final stop and the source of truth for a domain. It holds the official DNS records set by the domain owner, including the A record that maps the name to an IPv4 address and the AAAA record for IPv6.
What DNS records does a server hold?
A DNS server holds records that map names to addresses and services. The most common are A, AAAA, CNAME, MX, TXT and NS records, and each answers a different question.
| Record | What it does | Example use |
|---|---|---|
| A | Maps a name to an IPv4 address | example.com to 93.184.216.34 |
| AAAA | Maps a name to an IPv6 address | example.com to an IPv6 address |
| CNAME | Points one name at another name | www.example.com to example.com |
| MX | Points mail to the right mail server | Receiving email for a domain |
| TXT | Holds text, often for verification | SPF, DKIM and DMARC records |
| NS | Names the authoritative servers | Delegating a domain to a provider |
TXT records deserve a mention for security. Email authentication records such as SPF, DKIM and DMARC live in TXT records, and a missing or wrong record is a common reason mail is rejected or spoofed. You can check yours with the free DNS lookup tool.
Read our guide to what DMARC is, and see how Cloudflare explains DNS in its learning centre.
Records have a TTL, which sets how long a resolver may cache them. A short TTL lets you change an address quickly; a long TTL reduces load on your servers. Pick the TTL before you need to move in a hurry.
What are the best public DNS servers?
The best public DNS servers for most people are Cloudflare at 1.1.1.1, Google at 8.8.8.8 and Quad9 at 9.9.9.9. They differ on speed, filtering and logging, so pick by what matters most to you.
Cloudflare (1.1.1.1 and 1.0.0.1). It runs on a large anycast network. Its privacy policy says query logs are deleted within 25 hours and never sold. The default address does not filter; 1.1.1.2 adds malware blocking and 1.1.1.3 also blocks adult content.
Google Public DNS (8.8.8.8 and 8.8.4.4). The stability benchmark, running on Google's infrastructure. Google documents what it logs and for how long. It validates DNSSEC, supports DoH and DoT, and returns exactly what the domain publishes. Temporary logs with IP addresses are kept for 24 to 48 hours.
Quad9 (9.9.9.9 and 149.112.112.112). A Swiss non-profit that blocks lookups of domains tied to malware, phishing and botnets by default, using threat intelligence from multiple partners. Its service addresses and features page lists the filtered and unfiltered options. Its policy states user IP addresses are not stored. The unfiltered address is 9.9.9.10.
Other useful options include OpenDNS at 208.67.222.222 for family filtering and AdGuard DNS at 94.140.14.14 for ad and tracker blocking. All of these are free, and switching takes a few minutes.
| Provider | Primary / secondary | Filtering | Encrypted DNS |
|---|---|---|---|
| Cloudflare | 1.1.1.1 / 1.0.0.1 | Optional, at 1.1.1.2 | DoH, DoT |
| 8.8.8.8 / 8.8.4.4 | None | DoH, DoT | |
| Quad9 | 9.9.9.9 / 149.112.112.112 | Malware blocking by default | DoH, DoT |
| OpenDNS | 208.67.222.222 / 208.67.220.220 | Family filtering options | DoH, DoT |
How do you change your DNS server?
You change your DNS server in your operating system, browser or router settings. Changing it on the router covers every device on your home network at once.
On Windows, open network settings, edit the adapter's DNS settings and enter the primary and secondary addresses, for example 1.1.1.1 and 1.0.0.1. On macOS, the same addresses go in the DNS tab of your network settings. On Android, Private DNS uses encrypted DNS; on iPhone, you can set DNS per Wi-Fi network.
Most browsers also offer secure DNS settings, which use DNS over HTTPS even if your system DNS is unchanged. In Chrome and Firefox, look for the secure DNS or DNS over HTTPS option and pick a provider or enter a custom address.
After changing, test it. Visit a few sites, then check a domain with the DNS lookup tool to confirm records resolve. If pages fail to load, revert to your ISP's automatic settings and try again.
Is DNS secure? What can go wrong?
Plain DNS is not encrypted. Queries travel in clear text, so anyone on your network or at your ISP can see which domains you look up, and an attacker can try to poison or spoof answers.
Common attacks include DNS spoofing, where a fake answer redirects you to a malicious site, and DNS hijacking, where settings are changed to point you at an attacker's resolver. Cache poisoning, where a resolver is tricked into storing a wrong answer, is rarer today but still a real risk.
Three defences help. DNSSEC adds cryptographic signatures so a resolver can verify that an answer was not tampered with. DNS over HTTPS (DoH, RFC 8484) and DNS over TLS (DoT, RFC 7858) encrypt the query itself: DoH sends it inside HTTPS on port 443, while DoT uses TLS on port 853. A filtering resolver such as Quad9 adds a third layer by refusing to resolve known malicious domains.
Encrypted DNS hides your lookups from others on the network, but it does not hide your IP address or your traffic from the resolver itself. Changing DNS does not change your IP, and masking your IP needs a VPN. For the wider picture, see our guide to securing your Wi-Fi.
How do you fix DNS server problems?
Most DNS problems are fixed by flushing the cache, restarting the router, or switching resolvers. Work through them in that order before changing deeper settings.
Start by checking whether the problem is one site or all sites. If only one site fails, the site itself may be down or its records may be wrong. If every site fails with a DNS error, your resolver or connection is the likely cause.
- Flush the DNS cache. On Windows run
ipconfig /flushdns; on macOS use the DNS flush command for your version; browsers have their own DNS cache too. - Restart your router and device. This clears stale state on both ends.
- Try another resolver. Switch to 1.1.1.1 or 8.8.8.8 temporarily and reload the page.
- Check the domain. Use a DNS lookup to see whether the domain has valid A and NS records at all.
- Check for hijacking. If you land on unexpected pages, check your DNS settings for addresses you did not set, and scan for malware.
If a site loads on mobile data but not on Wi-Fi, the Wi-Fi DNS settings are the prime suspect. If it fails everywhere, the domain's own nameservers may be down, and only the site owner can fix it.
The bottom line
A DNS server does one job, and the whole internet depends on it: turn names into addresses, fast and correctly. The four server types share that job, caching keeps it quick, and encrypted DNS keeps your lookups private in transit.
For most people, the practical move is simple: pick a reputable public resolver, turn on encrypted DNS, and use a filtering option if you want malware blocking. You can check how any domain resolves right now with the free DNS lookup tool.
Frequently asked questions
What is a DNS server in simple terms?
A DNS server is like a phone book for the internet. You give it a name, such as example.com, and it returns the number, the IP address, that your browser needs to reach that site.
What is the difference between a DNS server and a DNS resolver?
A DNS resolver, usually a recursive resolver, is the first server your device asks. It does the work of tracking down the answer. Other DNS servers, such as authoritative nameservers, hold the actual records for a domain.
What happens if a DNS server goes down?
If your resolver is down, names stop resolving and sites fail to load even though your internet connection is fine. Switching to another public resolver, such as 1.1.1.1 or 8.8.8.8, usually restores browsing.
Is changing my DNS server safe?
Yes, if you use a reputable public resolver. Stick to well-known providers such as Cloudflare, Google or Quad9, and prefer one that supports encrypted DNS. Avoid random DNS addresses found in forums.
What is the fastest DNS server?
It depends on where you are. Cloudflare at 1.1.1.1 and Google at 8.8.8.8 are both widely used and reliable. The only way to know your fastest is to measure from your own network.
What is DNS over HTTPS?
DNS over HTTPS, or DoH, sends DNS queries inside ordinary HTTPS traffic on port 443. That encrypts the query so others on your network cannot easily see which domains you look up.
Can a DNS server block malware?
Some can. Quad9 blocks lookups of known malicious domains by default, and Cloudflare offers filtered variants at 1.1.1.2 for malware blocking. That helps, but it does not replace antivirus or a patched browser.
Do I need to run my own DNS server?
Almost never at home. Your ISP or a public resolver handles it. Businesses and larger networks run their own authoritative servers for their domains and often run internal resolvers for staff.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against Cloudflare's DNS learning centre, Google Public DNS and Quad9 documentation, and RFC 1034.
How we write and fact-check →