How Websites Go Live from Code to Browser

Introduction:

Have you ever wondered how a website open when we type a few words in the web browser, even a website is code written by a developer in his or her computer who may be staying at a different part of the world. Then how can we access that website?

How is it possible?

The developer develops the website in his/her system but if any other person wants to see this website in their system it may not be possible unless both the systems are connected to same network but what if the user is not connected to the same network, so the developers of the website host their website in a server, few maintain their own server whereas few use cloud servers. These servers have their own Ip address which acts like address to the place where the website is located, using these IP’s we can open a website, but remembering the digits of an Ip might be difficult and confusing, so the developers buy a domain name for their website from different domain registrars like GoDaddy, Name Cheap etc., using these domain names the user can view the website.

How it works?

A website's domain name and Ip address are stored in DNS server which is maintained by Internet service provider. In the server, the domain name and Ip are stored in key value pair manner.

User Input:

  • When a user enters a domain name in the browser, the request goes to the DNS server and checks if it is present.

DNS Look up:

  • If it is not present, we get a message “This site can’t be reached”.
  • If it is present, then the DNS server gives the Ip address of the website as a response.

Browser Request:

  • Now using this Ip address browser finds the server where the website is hosted and requests the server for the website

Server Response:

  • The server processes the request and sends responses to the browser.

Rendering:

  • The browser parses the html content, applies CSS styling and executes JavaScript so that we can see the website.

How are domain names assigned?

Whenever we want to buy a domain name, we can contact domain name registrars. They act as a mediator between us and the top-level domain registry operator i.e. they are responsible for domain names for specific top-level domains (.com, .org etc.,).

Conclusion:

Before a web page becomes visible in the browser, several background processes take place like communication between DNS server and browser, Communication between browser and Web server and Rendering of the website etc.,