DNS (Domain Name System) is the Internet’s way of converting human friendly website names into computer friendly IP addresses.
Every website has an IP address, it works very similarly to how every telephone has a phone number. The problem is that these numbers aren’t memorable to people. We much prefer names.
For example, you’ve heard of Google but you probably don’t know what Google’s IP address is. That’s where DNS comes in.
Why Do We Need DNS?
Every computer connected to the Internet has an IP address (Internet Protocol address). An IP address is a long string of numbers, rather like a telephone number.
The IP address identifies each individual computer on the ‘net. In the same way that a telephone number identifies each phone.
The problem is that we humans, whilst rather good at remembering names, are poor at remembering numbers, particularly long numbers.
For example, scrolling through your phone book, you’ll identify individuals by their names, not by their phone numbers.
When you tap on a contact to call or text, you’re tapping on someone’s name. But your phone loads up that person’s phone number. Essentially, what it’s doing is converting the name you tapped into a number, a phone number.
Website IP Addresses.
The same is true when you’re searching the Internet for a website. Imagine searching Google for Amazon, Netflix, Facebook etc, and seeing just the IP addresses of those websites.
Finding Your Own IP Address.
If you’d like to see your own IP address, simply search Google for “What’s my IP”. You’ll see several sites displaying your IP address.
The Domain Name System (DNS).
DNS is the Internet’s way of doing exactly the same for website names as your phone does for your contact’s names. It converts website names into IP addresses.
In order for your computer to connect to a website, it needs to know what that website’s IP address is.
DNS servers simply store data that matches a domain name (a website name) to its corresponding IP address.
So that’s the simplified version of “What is DNS?”. Below we’ve got a more in-depth view of how the Domain Name System works.
How Does DNS Work?
As you can imagine, there are many millions of websites are on the Internet. Storing, searching and then delivering the IP addresses for an individual website is an enormous task. But that is precisely what has to happen in order for us to be able to connect to any given site.
Not only that but there are millions, possibly billions of us trying to get that information, all at the same time.
So the process is broken down into different stages and the data (the DNS records) is split between different types of DNS servers.
The DNS Lookup.
The whole process is known as a DNS lookup. It all begins when you click on a website name in the search results or from your bookmarks/favourites list.
If you’ve visited that website recently, then your computer may already know the IP address. Both your web browser (Chrome, Edge, Brave etc) and the operating system (eg Windows) maintain a DNS cache of website names (domain names) and their respective IP addresses.
If your browser is given the IP address from your own computer cache, then that’s all it needs. The browser can then send a request for whichever webpage you’ve clicked on.
But if the IP address isn’t in your local cache (on your own computer), then your browser sends a request to your ISP’s (Internet Service Provider) DNS server for the IP address. This first DNS server is called the DNS Recursor or DNS Resolver.
The DNS Recursor/Resolver.
It’s the DNS Recursor/Resolver that is now responsible for finding out what the IP address is for the given website that you’ve requested. The resolver is going to act as a kind of middleman, or agent, on your behalf.
Firstly, the resolver will check its own DNS cache to see if it already has the information.
If you’re trying to reach a well-known website, such as Facebook, Amazon, Google etc, the chances are pretty good that someone else, who is also using the same ISP as you, has already visited that site today.
If that’s the case, then all the work of resolving the query has already been done and is cached. The recursor/resolver will simply send the IP address back to your computer allowing your PC to send a request for the relevant webpage.
If the resolver doesn’t have the information (the IP address), then it will begin sending out a series of queries to other DNS servers in an attempt to find the IP address of the website you’re trying to reach.
Root Server, Top Level Domain Server & Name Server.
DNS servers are arranged in a pyramid-style hierarchy. At the top are the Root Servers. These are followed by the Top Level Domain Servers (TLD Servers) and finally, there are the Authoritative Name Servers (Name Servers).
A website address (domain name) is associated with a particular DNS hosting provider’s name servers, which are responsible for resolving the IP address of that website.
If the resolver can’t resolve the query (it doesn’t know the IP address of the website you’re trying to get to), then it will need to track down the authoritative name server (or name server) that holds the information.
Root Server.
The recursor/resolver will contact a root server first.
The root server will check the very end of the website address, the .com .uk .fr .de etc. That’s known as the Top Level Domain (TLD). Each Top Level Domain has its own DNS servers.
For example, if the website you’re trying to reach ends in .com, then the root server will send the resolver the IP address for the TLD server that holds the .com data.
The resolver will cache the data for future use and then contact the relevant top level domain server.
Top Level Domain Server (TLD).
The recursor/resolver requests the IP address from the TLD servers for the IP address of the website you want to connect to.
The TLD servers don’t actually hold that information. Instead, the TLD server will reply to the request with a list of IP addresses for the relevant name servers for that website.
The resolver caches the data for future use and then contacts the relevant name server.
The Authoritative Name Server (Name Server).
Finally, the resolver has reached a DNS server that actually knows the IP address of the website you’re trying to reach.
The name server replies to the resolver with all the information it requires, which is both cached and returned to your computer. Your PC will, in turn, cache the IP address and then send out a request for the web page that you clicked on.
Should You Change Your DNS Server?
Changing the DNS server that your computer uses is actually fairly easy to do. And yes it can make a difference. Generally, on our home computers, we’re using the DNS server provided by our ISP. If that isn’t up to the task, then websites will load slowly.
There are a few free to use public DNS servers that you change to if you wanted to try it out. There’s no harm because you can always switch back to your original DNS server at any time.
Keep Up With Home Computer Guides.
All the latest guides and articles published on At Home Computer delivered to your inbox.
No account needed, just add your email address.