computers and servers can't comprehend "google.com". if computers don't understand words how do they find each other on the internet? how do they even connect me to google.com (yes, i ignored the quotations)? there are bunch of distributed machines across the world whose job is to do exactly this.
most likely you would be using a home network, or a public wifi. every device in a private network talk to the internet using the router (the gateway). when i press the enter key after entering google.com in my browser, the browser sends a request to a machine that will bring about the entire process of finding the IP address that i requested (your ISP/Google/Cloudfare etc).
this machine is called the "recursive DNS server" (this is more like a librarian who knows where to find the book that i ask) which will send out a request to the big boss - "root DNS server". root DNS server identifies the top level domain (TLD) of the domain that i asked (google.com) -> ".com" and returns back the list of TLD servers corresponding to .com TLD.
the recursive dns server has the list of TLD servers and now it asks one of these for google.com, the TLD server returns a list of "authoritative DNS servers" (also called nameservers) which contain the mappings of the requested domain to its IP address (they contain the master list).
now, the list is with the recursive DNS server. so from the list of authoritative DNS servers, it picks one and requests it for the IP address for google.com. the authoritative DNS server now checks the mappings for google.com and boom, it found the IP address finally - 142.250.182.65 !!!
(try searching for the location of this IP address).
now my browser connects with the server that has this IP and establishes a secure HTTP connection, so that i can browse safe. all of these, my friends, happens almost instantaneously - which is exactly what makes me jaw drop!
all of this is the hard way though. our computers are smart - when the IP address is resolved, the recursive DNS server, my browser and my OS keeps this in their memory by storing in cache. the IP addresses are stored with a TTL (time to live, measured in seconds). once the TTL expires, all this process happens again. the TTL is not a fixed number, it varies from 1 minute to some hours to 1 day to several days, sometimes.
some extra stuff for the curious ones :-
1) 142.250.182.65 is actually the GFE - Google Front Ends. GFEs usually handle the load balancing when we query it (google has an awesome and advanced load balancing architecture in place, a blog for another day).
2) for any website like youtube.com, ox.ac.uk (Oxford University), perplexity.ai, the top level domain is the right most part with the period(.). so for youtube.com it is .com, for ox.ac.uk it is .uk, for perplexity.ai it is .ai and so on. the TLD servers specifically handle the requests for one top level domain - .com / .ai / .coffee etc.
3) DNS actually stands for Domain Name System. it is a protocol that maps the domain names to their IP addresses.
4) sometimes the recursive DNS server could be your router too. to check yours, open your windows terminal and give this command - ipconfig/all. this will list you many things. look for 'Default Gateway' and 'DNS Servers' - if they are the same, then yes, your router is your recursive DNS server. you can also change your recursive dns server to standard providers like Google (8.8.8.8) or Cloudfare (1.1.1.1).
5) this recursive DNS server repeatedly queries other servers until it gets the IP, hence the name 'recursive'.
6) usually domains have more than one nameserver in place ensuring reliability and redundancy.
7) the bosses - root DNS servers are owned by 13 companies - look it up here (https://www.iana.org/domains/root/servers). this doesn't mean there are only 13 root dns servers. each root DNS server's operator have multiple servers that share the same IP managed via anycast (yay, topic for another blog!).
6) usually domains have more than one nameserver in place ensuring reliability and redundancy.
7) the bosses - root DNS servers are owned by 13 companies - look it up here (https://www.iana.org/domains/root/servers). this doesn't mean there are only 13 root dns servers. each root DNS server's operator have multiple servers that share the same IP managed via anycast (yay, topic for another blog!).
8) 4 pieces of octets, each octet having 8 bits, so IP address make up 32 bits in total.
PS: this blog is my first one. albeit this post is not perfect and anywhere near to the standards, i strongly believe in "Ship early, Ship often, Ship imperfect".
i am open to feedback and suggestions from you.
comment down and leave a like if you like!
1/n - with ❤️ from BitsFort
PS: this blog is my first one. albeit this post is not perfect and anywhere near to the standards, i strongly believe in "Ship early, Ship often, Ship imperfect".
i am open to feedback and suggestions from you.
comment down and leave a like if you like!
1/n - with ❤️ from BitsFort
No comments:
Post a Comment