For decades of using computers and the Internet for various purposes such as banking, entertainment, data processing, and other services, we sometimes tend to neglect principles that enable us to use the Internet in its current shape and form, today. One such concept is DNS – which stands for Domain Name System.
Computers typically tend to work with binary numbers, i.e. 0s and 1s. Even IP addresses – the typical ones we see and use around us – are converted into binary when computers actually need to use them. So, wouldn’t it be frustrating to put in IP addresses such as 184.108.40.206 every time you wanted to visit a service of your choice such as Facebook or Instagram or Linkedin? Here is where the whole DNS ecosystem comes to your rescue!
What is DNS, really?
DNS servers are simply like online address books – where each website / service that you may want to visit is mapped to an IP address(es). These servers will translate your human readable / writable website requests into IP addresses which are assigned to servers across the globe. So if you type www.facebook.com in your browser, the first thing the system will do is to resolve “www.facebook.com” to IP addresses that are responsible for getting you your Facebook feed.
Now that being the foundation, DNS does a lot more than just acting as an address book for domains to IP addresses.
DNS entries (Domain → IP mappings) are constantly being modified and replicated across hundreds of servers across the world, to ensure accuracy and reliability of your requests over the web. Just imagine if that hadn’t been the case – you’d end up visiting Amazon Shopping, even though you’re pretty sure you typed in netflix.com in your browser window.
Systems have been built to ensure that the DNS entries are cached, for a configurable time-to-live, across the world, to prevent slowing down of loading a web page – and for Websites that do not change their IP addresses often, which might not need the unnecessary round trip of DNS queries to load your services.
This essentially means that DNS is a lot more than just an address book – it is a constantly updated, synced and readily available address book, which can also act as a fault-tolerance layer for the services you consume. But how can an address book do anything from a fault-tolerance perspective you ask?
Well, DNS intrinsically allows you to add more than 1 IP address behind a domain name, which means that a service you may want to use – let’s say microsoft.com, will have more than 1 IP address, and they may change depending on where you are. So for example, at the time of writing this, microsoft.com for me resolves to 220.127.116.11, 18.104.22.168 and 22.214.171.124. All these IP addresses are owned or leased by Microsoft and are being used to serve the web page at https://microsoft.com.
What more can DNS do?
Now server failures and Internet outages may be more common than you and I can fathom, but here is where the fault tolerant systems of DNS and a few other methodologies kick in.
Assume that out of the 3 IP addresses listed above, under the domain microsoft.com – one of the servers fails due to a power outage, it can immediately trigger an update to the global DNS systems, notifying them that 126.96.36.199 is to be removed from the answers of the DNS query for microsoft.com. Within minutes, the entire globally maintained DNS address book will get updated to serve microsoft.com with only 2 IP addresses, instead of the prior 3, while the Engineering teams work to bring up the server that has failed.
These monitoring and DNS management systems work so quickly and seamlessly that you and I don’t even get a chance (well, in most cases) – that something is a-miss behind the scenes.
DNS systems host a whole lot of features, such as aiding geography based distribution of Internet traffic, dynamic IP assignments, DNS based Service Discoveries, etc. This is just a gateway in understanding the way the Internet functions, and how the world has accustomed itself to work around these principles.
If this piqued your interest, stay tuned because there is more to come!