Internet is currently available to everyone, but only very few people really know what happens when you request one of the sites that are available, in this article I want to explain how this whole process happens.
What happens when you type www.google.com or any other url in your web browser and hit Enter the first thing that happens is that your browser looks in its cache to see if that website was visited before and the ip address is known. If it cannot find the ip address for the requested url, it asks your operating system to locate the website, if the url is not found within, the operating system will make a DNS request to find the ip address of the web page. The first step is to ask the server to look in its cache to see if it knows the ip address, if it doesn't, it asks the root server to ask for the TLD .COM (Above Level Domain) - if your URL ends in .net, then the TLD server would be .net and so on - the TLD server will check its cache again to see if the requested ip address is there. Otherwise, it will have at least one of the authoritative nameservers associated with that URL, and after going to the nameserver, it will return the ip address associated with its URL. All of this was done in a matter of milliseconds.
Now that we have the IP of the server, finally the browser will be able to send a request with the GET method using the HTTP protocol (Hyper Text Transfer Protocol) so that the web server responds with the corresponding HTML, CSS and JavaScript files. The response is accompanied by the status code, there are 5 types of status detailed by means of a numerical code: 1xx indicates a message for information only. 2xx indicates some kind of success. 3xx redirects the client to another URL. 4xx indicates an error on the client side. 5xx indicates an error on the server side.
It is very possible that the communication is also carried out by the https protocol, which is an Internet communication protocol that protects the integrity and confidentiality of user data between their computers and the website. Since users expect their online experience to be secure and private.