How do you suppose your PC, smartphone, or tablet knows where to go when you type in a domain name like makeuseof.com? It’s not by magic—all internet connected devices make use of the domain name system, with DNS servers at its core.
But what is a DNS server, and how does it work to get you from A (a domain name) to B (the matching web server)? How do you know if your DNS server is responding properly or not? The system is designed to work without you even noticing, but it isn’t foolproof.
Let’s explain how DNS works, and what you should do if there’s a problem with your DNS server.
What Is a DNS Server?
There’s a reason that you, your neighbor, and your long-lost family abroad can all type a URL into your browser and see the same result. The domain name system is the foundation of the web, acting as a database of every single public-facing website.
A DNS server resolves an IP address for a web server and matches it to a domain name and host name (for www.google.com, the hostname would be www). The information is held in its entirety on 13 DNS root name server addresses, run by companies, government agencies, and universities. There are hundreds of matching root servers, hosted by these 13 organizations and sharing the same IP addresses across the globe for speed and reliability.
The reason for DNS is simple—it’s much easier for users to remember a domain name, like google.com, than they would an IP address.
For Google, that would be 184.108.40.206. If you hosted a website on your own server, you’d have to provide your own IP address if you weren’t using a free dynamic DNS provider or had a static IP address.
You’ll usually default to using the DNS servers provided by your ISP. You can also use public DNS servers to improve your safety online, like Google’s own public DNS servers at 220.127.116.11 and 18.104.22.168.
Why Might Your DNS Server Be Unavailable?
When your PC can’t find a domain name you’ve typed in, there could be a problem with your DNS server. Your DNS server might be unavailable because of a problem with the server, or a problem with connecting to that server (such as an internet outage).
If you’re using the DNS settings provided by your ISP, and you’re getting a DNS server not responding error, restart your router in the first instance. This may restore your connectivity to your DNS servers without any extra steps.
If that doesn’t work, resetting your DNS cache could help. On Windows, hit Win + X, select Windows PowerShell (Admin), then type:
On macOS, assuming you’re running El Capitan or later, open a terminal and type:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Linux-based operating systems don’t generally perform any DNS caching unless you’re using nscd. If you are, type the following:
sudo /etc/init.d/nscd restart
If all else fails, and your DNS server is unavailable for a long period of time, then it’s time to set your own.
Why You Should Set Your Own DNS Settings
In most cases, you aren’t forced to use the DNS servers that you default to using with your internet connection. You can set your device to use alternative DNS servers if you’d prefer.
As we’ve mentioned, changing your DNS server can be a good way to protect yourself online. For parents, changing your DNS servers to a provider like OpenDNS can help you with filtering against adult content and malware.
One of the biggest reasons for changing your DNS server settings, however, is for speed. A few additional seconds of loading time for each page can start to add up—you can reclaim that time by changing your DNS settings to a quicker provider. Your ISP DNS servers (depending on your provider) might be poorly maintained, resulting in a noticeable slowdown, even with a fast internet connection.
It also helps to change your DNS settings if the servers you’re using aren’t reliable and frequently go down.
If you’re thinking about using a VPN, you might also want to change your DNS server settings from those provided by your ISP. You’ll also want to set up a VPN connection in Windows to use DNS leak protection properly. If you don’t, DNS leaks might reveal your identity to snooping authorities.
The Dangers of DNS Malware
DNS spoofing (or DNS cache poisoning) can be a way for malware creators to manipulate the domain name system to benefit themselves. Rather than google.com taking you to Google’s homepage, DNS malware can set a record in your DNS cache to an alternate server. It might look like Google, the URL might match, but your PC will have taken you to another website entirely—all without you realizing.
This kind of sophisticated phishing attack can cause you to unwittingly reveal your personal data to a rogue server. To prevent this from happening, keep your antivirus and antimalware software up-to-date and run a scan of your PC on a regular basis.
If you do find malware, clear your DNS cache using the methods listed above once it’s been removed.
How to Set Your Own DNS Settings
You can change your DNS settings on modern operating systems like Windows and macOS quickly, although it’s a little trickier on Linux, depending on your distribution.
To change your DNS settings on Windows, hit Win + X and select Settings > Network & Internet > Network & Sharing Center.
In the menu on the left-hand side, select Change adapter settings. Right-click your internet connection and select Properties. Select Internet Protocol Version 4 (TCP/IPv4) and select Properties.
From here, enable Use the following DNS server addresses and fill in the preferred and alternate DNS server addresses with your chosen DNS providers. Follow the same for IPv6 addresses.
If you’re using macOS, click the Systems Preferences icon on your dock, then click Network.
Make sure your connection is selected, then click Advanced > DNS. Remove any existing DNS servers with the – icon, then hit the + icon to enter your new addresses. Once you’re done, click OK.
If you’re running Linux, changing your DNS settings will depend on the distribution you’re using. It’ll also depend on the network manager that distribution uses.
If you’re an Ubuntu user, you’ll need to manage your IP address settings on Ubuntu using either the GUI or by using a terminal editor to manually edit the relevant configuration files.
Don’t Let a Bad DNS Server Slow You Down
Under normal circumstances, you shouldn’t need to think about your DNS servers. They operate in the background, working to get you from A to B as you use the web without any issues.
If you do have issues with your DNS settings, it could be a sign of DNS malware or a problem with your internet connection. If that’s the case, check your PC for malware and, if you’re still having problems, try changing your DNS server settings to another provider.
Read the full article: What Is a DNS Server and Is It Responding?