Blog

What Is a DNS Server and What Is Used For?

What is a DNS server? The DNS is one of the most important systems of online browsing, and by extension, the internet. Thanks to DNS, your web browser can efficiently filter through billions of websites to find the one you want in a quick and user-friendly manner.

Have you ever wondered how entering a URL in your browser can instantly bring you to the website you want to visit? The scope of this task may not hit you until you realize that there are over 1.7 billion websites in existence, and over half a million new ones appear daily. And we can’t manage it all without the help of DNS. 

So what is a DNS and how does it work?

Let’s answer the big questions to give you a comprehensive perspective on its importance and function.

What Is a DNS Server?

To answer this question, we must first understand what DNS is.

What Is a DNS?

So what does DNS stand for? People often mistake the abbreviation for Domain Name Server, but it actually stands for a Domain Name System.

You might have heard about domain names. They’re the main part of the URL you enter in your browser. For example, “google.com” is a domain name that refers to the numeric IP address (Internet Protocol address) “216.58.216.164”.

The DNS meaning is simply a system that translates the website’s domain name to the corresponding numerical IP address. This system enables your browser to find the correct website.

To put it simply, DNS helps bridge the gap between humans and computers. Humans find it easier to remember domain facts than a single string of IP numbers. In contrast, computers find it easier to identify websites by their IP addresses.

When you enter a domain name, the DNS sends a query for access to the correct website IP address, allowing your browser to retrieve the website’s information. It all happens because of a server — a machine dedicated to answering DNS queries.

The server contains a database of domain names and their corresponding IP addresses. They work like a phonebook for the internet where you can find all the numbers (IP addresses) of all the contacts (domain names).

What Is DNS Hosting?

DNS hosting is a network service that provides servers for your domain name. It won’t be viable for every website owner to have their own servers, so the DNS hosting does the job.

When you purchase your domain name from a domain registrar, they typically provide DNS hosting for your IP address on their name servers. Website creators make this step very simple. They host the guide map that connects your domain to the IP address.

We don’t recommend free DNS hosting, like the ones offered by domain registrars. It goes against DNS best practices to use multiple services of the same provider. If your DNS host experiences an outage, no one will be able to connect to your website.

While the website will be live, no one would find its IP address. So you want reliable DNS hosting. The best way to get it is to use companies who specialize in hosting and don’t offer more.

When choosing a DNS hosting service, always look for good support, multi-factor authentication, reliable partners, and global server locations.

Primary and Secondary DNS Servers

The domain name and IP information are stored in a primary server, which holds the guide map for connecting a domain name to an IP address.

We also need backup to maintain smooth service. That’s the secondary server, which holds a copy of the guide map. If the primary fails to resolve online queries for a domain, the secondary steps in to answer.

The extra set of name servers adds redundancy to a domain and can assist in load management. Let’s see how it all happens.

How Does DNS Work?

DNS works by sending queries to the correct IP address and getting you access to load a webpage. That’s  done through different types of servers going through the query resolution.

Types of DNS Servers

They fall into four types:

  • DNS Recursor

A DNS recursor gets queries from the browser and typically makes extra requests to resolve them. Think of it as the attendant in a file room who takes your request for finding a record and locates the file containing what you requested.

  • Root Name Server

The root server is the source and first step in resolving DNS queries. It’s the reference to a more specific location for finding the correct IP address. You can think of it as the attendant locating the file cabinet that has the file you need.

  • TLD Name Server

TLD stands for Top-Level Domain, the .com, .org, or .net portion of your domain name. A TLD server is responsible for searching your IP address in the correct TLD. It points the attendant to the right section or rack of the file cabinet to locate the file.

  • Authoritative Server

It’s the final step in locating the IP address. Once that’s done, the authoritative server provides the DNS recursor with the IP address. It’s similar to the attendant searching a file for the record you requested and bringing it back to you (the client).

The Process of Resolving a DNS query

The attendant example shows that the DNS recursor or DNS resolver is the main server that’s doing all the heavy lifting to find your record (IP address). It’s responsible for resolving all incoming DNS queries. Here’s how the process, or DNS lookup, goes:

  1. It begins when you type a domain name like “www.google.com” in your browser.
  2. The first step is to look for the IP address in the browser or device cache (more on this later). If it can’t find it there, a DNS query is sent to the DNS recursor.
  3. The DNS recursor receives the query and searches its cache for the IP address. If it can’t find it, the query goes to the root DNS server.
  4. The root server doesn’t hold the IP address, but it can direct the DNS recursor to the correct TLD server.
  5. The recursor then queries the particular TLD server of “.com” for the IP address of “www.google.com”.
  6. The TLD server doesn’t have the IP address. It manages the “.com” section and can point the DNS recursor to the particular authoritative server that holds the IP address.
  7. Once again, the recursor makes one last query to the authoritative server. It responds with the correct IP address — “216.58.216.164” for “www.google.com.”
  8. Lastly, your DNS recursor sends this IP address to your web browser.

This gives your browser/device the IP address it needs to resolve “www.google.com.” And finally, you get access to the website from Google’s web server.

a lot of servers one on top of the other

What Is a DNS Cache?

DNS caching is the process of temporarily storing DNS data in a nearby location to improve the speed and performance of the DNS lookup. A cache is the nearby location where the DNS data stays temporarily, determined by a time-to-live (TTL).

It allows early and efficient DNS queries resolution by avoiding the additional steps in the DNS lookup. This improves the load times of your websites while reducing CPU and internet usage. There are many locations to temporarily “cache” DNS data, including:

  • Browser DNS Cache

It makes sense to store DNS data as close to your web browser as possible for the fastest DNS lookup. So modern browsers come with their own cache to temporarily store the data. That’s why the first step of the DNS lookup is to search the browser cache for the IP address.

  • OS Cache

The operating system cache is the second closest place to store DNS data. It’s the last local location, or cache, to check for the requested DNS resolution before a DNS query is launched to a DNS recursor.

Your OS gets the request from your browser to search for the IP address inside the OS cache. If it can’t find it, a DNS query is launched outside your local network to a DNS recursor.

What Is a DNS Configuration?

Most primary and secondary servers are provided by your Internet Service Provider (ISP). They work relatively well because they’re closer to you, meaning DNS queries take less to resolve. If you type “www.google.com,” your ISP’s DNS servers can likely resolve it faster than Google’s. But for a website like  “www.google.com,” you probably have the DNS data cached in your browser or OS.

ISP servers are automatically configured to your device or router when you connect to the internet. Several servers are open for public use. A DNS configuration allows you to choose the server you want to use for your queries, whether automatic or manual.

The reasons for a DNS configuration are simple. You may want to use a different set of servers for faster, safer, or more accurate resolutions. A DNS configuration will subdue the automatic settings of your router to your ISP’s servers.

This can be useful if you want to:

  • Access region-restricted content like Netflix from another country
  • Restrict online content for children
  • Have more secure browsing from a DNS server that offers such benefits

A DNS configuration is also helpful for problems like:

  • Websites not loading 
  • Websites loading slowly
  • DNS error because of your internet connection or a DNS problem.

What Is a DNS Error?

A DNS error indicates that you cannot access a website or the internet. These often display on your browser with codes that mention DNS in them. You can get different DNS errors with reasons including:

  • Your network connectivity could be at fault, not your DNS.
  • Your modem or router may have issues causing DNS failure.
  • Your device may have contracted a virus or malware restricting DNS functions.
  • Your antivirus could cause DNS failure due to a database update.
  • The DNS server may be down and no longer responding.

Depending on the cause, you can fix the error by:

  • Trying a different device or browser
  • Restarting your router or modem
  • Switching servers by implementing a DNS configuration

Most DNS errors are common and not difficult to overcome, but we’ll get to that later.

The worst cause of a DNS error is DNS hijacking.

DNS Hijacking and How to Protect Yourself

Cybercriminals launch attacks like Domain Name System hijacking to benefit from malicious activities. That’s also known as DNS redirection and causes DNS queries to resolve incorrectly. In the end, that redirects your browser to malicious websites predetermined by the hackers.

They do this in three ways:

  • Installing malware on your device (local DNS hijack)
  • Hacking DNS communications (man-in-the-middle DNS hijack)
  • Taking over your routers (router DNS hijack).

DNS hijacking is mainly for pharming and phishing. Pharming allows hackers to generate revenue by displaying ads on your device. Phishing lets them steal your data or sensitive information by redirecting you to a fake version of the website you intend to visit.

Hijacking is among the most common DNS attacks. It may surprise you that some ISPs and government organizations resort to DNS hijacking to:

  • Collect data (phishing)
  • Generate revenue (pharming)
  • Practice censorship through DNS servers

But there are things you can do to protect yourself. Basic practices can help prevent DNS hijacking:

  • Regularly changing your router password
  • Installing and updating antivirus software
  • Using reliable VPN services

If you suspect your ISP of DNS hijacking, simply perform a DNS configuration and use a more secure public server. We’ll share and discuss some of the best, most reliable, and secure free public DNS servers at the end.

yellow cable hanging from a server

How to Resolve DNS Issues

You can easily solve most DNS errors or issues by yourself. Simply follow these steps, and you’ll be good to go:

  • Make sure it’s not an ISP issue

A simple way to ensure that your DNS server issues aren’t ISP-related is to try another device. Use it to connect to your router and check if the problem persists. If possible, bypass the router and connect directly to your ISP.

If the other device fails, contact your ISP and find out if they’re experiencing any problems that may be causing your DNS issues. 

If the other device works fine and shows no DNS issues, you can ensure that your ISP isn’t causing the problem.

  • Restart hardware

You can often solve tech issues by simply restarting the hardware. For DNS problems, you’ll have to restart your router and modem. You can even put your device in the mix. Just make sure that all hardware is switched off for at least three minutes before turning it back on.

  • Flush your DNS cache

Sometimes your cached DNS data may not be updated to the latest server changes of the website you’re trying to visit. Or perhaps you have malware that’s redirecting you to the wrong websites. In either case, flushing your cache may help solve the problem. Here’s how to do it:

  • For Windows — Open Command Prompt and type “ipconfig /flushdns” and press enter. If it’s successful, the Command Prompt will respond with “ Successfully flushed the DNS Resolver Cache.”
  • For macOS X Lion and beyond — Type “sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder” into the Terminal and press enter.
  • For macOS X 10.10.1, .2, and .3 — Type “sudo discoveryutil udnsflushcaches;sudo discoveryutil mdnsflushcaches” into the Terminal and press enter.

Mac users won’t see a response, but they can check if the DNS issue is resolved by connecting to the website again. Windows users should do the same, and if the DNS issue isn’t resolved, try the next step.

  • Check your power settings

Power settings often hinder the function of your wireless adapters, especially when your device is in energy-saving mode. You can change the settings to maximum performance and check if your device connects to a DNS server.

  • Try a clean reboot

Often a simple restart won’t do the trick, and your computer may require a ‘clean reboot’. That may fix DNS issues because it allows only essential programs and systems to run on start-up and avoid any glitches from conflicting ones that may be causing the DNS issue.

You can easily find the clean reboot process for your specific operating system online. We won’t mention them all here as they vary slightly for most operating systems.

  • Switch to a public server

Your current server or your ISP’s server may be the culprit. Switching to a reliable public server may solve your issues.

What’s the Best DNS Server?

While security, reliability, and features are major factors, we often consider the fastest DNS server to be the best one. But speed is a relative term as it depends on how close you are to the server. That’s why ISP servers work so well.

An easy way to choose a server is to download a free DNS Benchmark and run it on your device. It’ll reliably show you the fastest servers nearby. Still, the top result may be your ISP’s server since it’s the closest to you, and your router may be returning cached results faster.

There are options to remove it from your benchmark, or you can just ignore it. The results will show the fastest DNS servers, and you pick the one you like for its security, reliability, or features.

Lastly, here’s a cheat sheet for some of the best, most reliable, and secure free public servers. You can check each one individually to find the fastest for your location.

ProviderPrimary DNSSecondary DNS
Google Public DNS8.8.8.88.8.4.4
Quad99.9.9.9149.112.112.112
OpenDNS Home208.67.222.222208.67.220.220
Cloudflare1.1.1.11.0.0.1
CleanBrowsing185.228.168.9185.228.169.9
Alternate DNS76.76.19.1976.223.122.150
AdGuard DNS94.140.14.1494.140.15.15

Remember that free public DNS servers are like any other service or business, so they can be removed at any time. You’ll have to keep a check on the one you decide to go for.

Conclusion

The DNS is incredibly useful and enables easy and efficient human to computer translation of domain names to IP addresses. You shouldn’t be surprised that modern technology allows different servers and caches to carry out the entire lookup process in mere seconds or less.

Imagine a world without DNS. You’d have to remember or note down each IP address and get updates every time the website changes servers. A single wrong number and you’d never connect to the right website.

It would be a digital logistic nightmare.

So, what is a DNS server? Hopefully, you now have a comprehensive understanding of DNS and can answer that question yourself.

About the author

Terry Stancheva

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.