Ever wondered how your browser knows where to go when you visit a website? Let's break it down step by step:
- You type the website address (like https://www.100daysofcode.io) and press enter.
The website’s name (100daysofcode.io) is called the domain. Every domain is linked to a server. Your browser asks a special service called DNS (Domain Name System) to find the IP address of the website, which tells the browser where the server is located.
- The browser connects to the server using the IP address.
- The browser sends a request to the server. The request contains request line, headers, and body.
- The server sends back the response based on the request. The response contains status, response headers and the requested content. The content can be HTML page, css, javascript or image files.
- The browser puts it all together. Finally, the browser takes all the content and displays the website on your screen.