Imagine trying to remember 22.214.171.124 or 126.96.36.199 at all times. Difficult? Well half of your life would lose meaning if you don’t remember these IPs. Why? It’s one of the IPs to reach Google and Facebook!
So why aren’t we memorizing IPs at all times?
Because we have a blessing called DNS to our rescue.
DNS stands for Domain Name System and the simple task of a DNS server is to make IP addresses translatable via names. This way, when you try and reach google.com, the DNS server your request reaches to translates it into an IP address which your browser than uses to reach google’s servers. Border Gateway Protocol is the routing protocol of the internet and at that level, from a connectivity point of view, IP reigns supreme as every device in the path is designed to understand IP addresses to route traffic.
DNS lookup is the first function performed by your browser as it knows without a resolved IP address, the request is getting nowhere.
So which DNS server are you using?
If you are at home, most likely your wifi router has forced all clients connected to it to point to itself for all DNS queries. Your wifi router doesn’t have local records of any domain names as such but it knows which DNS servers to point to resolve your name queries.
Over the internet, domain name servers have a mesh of interconnectivity. This way when one DNS server doesn’t know about the IP related to a requested domain name, it simply points to another server until either the request is resolved or fails.
You can manually configure your DNS server on your home computer to point to 188.8.131.52 and all your requests would point directly to google’s DNS instead of your ISP’s DNS.
Similarly, you can also use a protection service which is DNS based whereby your home router would point to the DNS service and apart from resolving your name requests, the DNS service would also protect you from malicious websites as it would block your requests to access unsecure addresses. This way you can protect your devices from harmful content. Cisco Umbrella is an example of a similar DNS based premium service.
The reason some websites open faster than others is primarily because they have cached content placed strategically near you so that there are minimal hops between you and the content you intend to reach. DNS plays an important part in this process. The DNS service ensures you get the IP address of your nearest cached server. It achieves this by looking at your source IP address and since your IP address also reveals your geographical location, the resolved IP would be of a server located near you.
Global domains such as Google, Facebook, Twitter etc are all present in multiple locations over multiple data centers and constantly provide their content from these locations. They home in this feature of DNS and spread their content delivery network across to deliver content from the nearest possible location. All this, whilst replication takes place at the back between all data centres.
To understand the concept of Content Delivery Networks (CDN) with spread out data centers, refer to my video below.