DNS (Domain Name System) is the backbone of the internet, you may not know it yet but 99% of what you do online requires and uses DNS. DNS is the internets version of a phone book, but instead of resolving names to phone numbers it resolves names (Domain names) to ip addresses.
What is an IP address? – Well an IP address is a 4 block number (This is for IP Version 4, it wont cover IP version 6 here!) that ranges from 0 to 255. for example: 121.10.45.66 Every network or machine that uses the internet needs an IP address to communicate with other systems, much like everyone who wants to use a phone needs their own phone number!
Why do we need IP addresses? – Every system or network on the internet needs to be uniquely identified so we can locate it on the Internet. The Internet is not operated centrally, it is a series of networks that are all joined together and identified by their IP addresses.
So what is DNS then? – Well imagine we wanted to access a website, the website is located on a web server that is at the ip address of 55.13.90.88, how would we know this information? Well we wouldnt, it just wouldnt be practical trying to remember a number like this for each website we wanted to visit, that why we use domain names, there much easier for us to remember. All domain names do is make life easier (a lot easier!) for us when were using the internet. So when we are accessing http://www.xyz.com we are actually accessing http://199.26.172.101
How does DNS work? - DNS works on a hierachial structure. When you try to access www.xyz.com your computer does not initially know where the web server is located, so it needs to do a DNS lookup to find out which ip address the server is localted. Your computer will then query its primary DNS server and ask for the answer. Chances are your primary DNS server might be your router. Your router will generally not hold any DNS records and will simply be used a forwarder, it will have its own DNS server configured that it will query (normally your ISP’s DNS server). It will query it and ask it for an answer, there is a chance that your ISP will already have the answer and it will be stored in whats know as the DNS cache, in which case it will return the answer to your router, which will return the answer to you. Your computer now knows the IP address of xyz.com and can start sending data to it.
What if my ISP’s DNS server doesnt know the answer? – If this is the case then the ISP’S DNS server will then query the next server in the chain, this could be a more authorative DNS server that the ISP owns or it could pass the request on to a root DNS server. A root DNS server will always have an answer. If the address has been registered and is globally accessible then the root DNS server WILL have the answer.
What are the root DNS servers? – These are the main DNS servers, they have all the answers and they are queried when a less authorative DNS server doesnt have a record for a domain name. There are 13 DNS root servers around the world and many would consider these to be the backbone of the internet. To put this into context consider this scenario; if all 13 root DNS servers were taken offline then all other DNS servers would eventually expire their cache and empty, if this happened nobody would be able to resolve any external domain names, therefore bringing much of the internet to a standstill.
This is DNS in a nutshell, I have only really scratched the surface here and it is a massive subject indeed but this should provide you with the very basics of what DNS is and how the internet relies on it.
