I tried to understand what actually happens when I type a URL in the browser and press enter.
When I type a website like www.facebook.com the process starts from my system which acts as the client. The browser first needs to find the IP address of this domain because machines understand IP addresses only.
So the browser starts a DNS query. It first checks if the IP is already stored locally. If not, the request moves to the sub resolver. This sub resolver sends the query to a main resolver,
The main resolver now finds the IP address. It starts by contacting the root name server. The root server doesnโt know the IP, but it points to the TLD server. TLD stands for Top Level Domain, like .com, .org, etc.
the resolver contacts the TLD server. The TLD server responds with the sld which handles the specific domain (this is second level domain, like amazon).This server contains the zone file which has the mapping of domain names to IP address.
Once the IP address is found, it is sent back through the chain to my browser. Now the browser knows where to send the actual request.
After this, the browser sends an HTTP request to the server using that IP address. This request has different types. The GET which is used to fetch data like a webpage. POST is used to send data to the server. PUT is used to update data, PATCH is used to partially update data, and DELETE is used to remove data. a secure connection may be given using TLS (Transport Layer Security). This ensures that the data is encrypted and safe while traveling. This is what happens when we use HTTPS.
Finally, the request reaches the server. The server process the request and sends back a response which travels back to the browser. the webpage appears on the screen.
This entire process happens in just a few milliseconds.
Top comments (0)