- You will first open the browser and the whole page or interface that you see is called web app or application layer, because application(graphical web-pages) visible to the user. The default browser may be chrome/firefox/brave etc. You click on the search box or search engine and start typing or? searching for? www.google.com and enter.?
- Interesting Fact: While you just entered “g” in the searched box, Browser starts suggesting you. The suggestion algorithms depend on search history, bookmarks, cookies, popular searches, etc.
- NOTE: HTTP/HTTPS protocol is used behind the scenes for web pages.
- After searching for www.google.com . Your browser parses or separates protocol, domain name and resource from it. To do the same, first the browser decides which protocol to use. HTTP or HTTPS. After protocol gets decided, mostly HTTPS are used. Now turn to find a domain name. As the domain name provided by user is, domain name is www.google.com. After getting a domain name? it will be replaced by an IP Address. In real life, when you call a friend, you search for his name from a Contact list but as you make a call, internally your friends name gets replaced by phone number. Similarly, in the case of the internet communication, domain name has to be replaced by IP Address internally. And finally the call goes to the phone number or IP Address which is mapped to friend name or domain name respectively. Now the questions arises is: How IP Address obtained ??
- Let go into detail how IP is obtained from domain names, i.e. www.google.com .?
- To? get an? IP Address from Domain name DNS protocol is used. The DNS protocol present in the application layer returns an IP Address for? www.google.com. The qustion arises is: How DNS retrieves an IP Address or How DNS works?
- Domain Name is similar to mapping a mobile number with an owner's name. Similarly, IP Addresses are mapped with domain names for easy memorizing.
- Everything? entered after https:// in this below example forms the FQDN. Here, the FQDN is www.google.com/. Just for clarification, if I used the URL https://www.google.com/mail/, the FQDN would still be www.google.com. FQDN is the data between the second and third slashes(“/”) that form the FQDN. I've used a URL in my example here, but we can and do use FQDNs in lots of different ways. FQDN is subdivided into 3 parts:?
- 1) Top Level Domain(TLD): Examples: ".com", ".org", ".gov", ".edu"
- 2) Domain name: Example: "google", "facebook", microsoft", "amazon", etc
- 3) Host Domain: Examples: "www", "mail", "ftp", "docs", etc.
-
So, Finally DNS query has to be made for: www.google.com
The client on the left-hand side wants to communicate with www.google.com ?and follows the following process:
- DNS query to be made for OR To retrieve IP Address for domain: www.google.com
- It checks its own DNS cache for IP Address to corresponding domain but finds no entry.
- It sends a query to the DNS server specified in the host's configuration.
- The DNS server checks its own DNS cache but finds no entry. Rather than replying negatively to the host, it undertakes recursive queries.
- It sends the query to the Root DNS server. Root DNS Server contains the IP Address of Top Level Domain Server like ".com", ".org", etc. It will return IP for ".com" DNS Server.
- The root DNS server doesn't know the IP address for the queried FQDN(www.google.com ), so it replies to the local DNS server, advising the IP address of the .com DNS server.
- The local DNS server sends the query to the .com DNS server.
- The .com DNS server doesn't know the IP address for the queried FQDN(www.google.com ), so it replies to the local DNS server, advising the IP address of the google.com DNS server.
- The local DNS server sends the query to the google.com DNS server.
- The google.com DNS server checks its records for www.google.com respectively.
- Upon finding an entry, it replies to the local DNS server by providing the IP address of FQDN(www.google.com).
- The local DNS server updates its own DNS cache with the entry.
- Then, it replies to the original host, advising it of the IP address for www.google.com .
- On receipt of the IP address, the client updates its own DNS cache.
Once the client has been given the IP address for the corresponding domain name, then it can start communication with retrieved IP Address: 8.8.8.8
If you have observed, the query has been made from, ".com" server --> "google" server ---> "www" server i.e from right to left. So, I think you got to know about:
- What is application layer ?
- What is FQDN ?
- How IP Address is obtained from domain name ?
- How DNS Works ?
Thanks for reading !! Hope you Liked it. And do comments for any doubts.
Founder - CloudEngine Labs | Chief Technology Evangelist | HashiCorp Ambassador | AWS Community Builder | DevOps Cloud SRE Practitioner | Tech Blogger | Speaker | Mentor | Platform Engineering Expert | AWS | Azure | GCP
2 年Good one Vivek!! ??