What happens when you type google.com in your browser and press Enter?
Obah Sylva
Full Stack Engineer | AI & Web3 Integration Specialist | Next.js & React | SEO Expert | Outsystems | Blockchain Enthusiast | Editor | Copy Writer | Data Analyst, actively seeking internship and job opportunities
We all enjoy browsing the internet. For many, it is like magic that we can get answers and solutions to most of our questions and problems.?But have you ever wondered what really happens when we type www,google.com or any other domain name and press enter?
?
In this article, I will not only touch the surface, but I will also delve into the intricacies to enable you to have a complete understanding and develop technical proficiency concerning how the web operates. Do not be apprehensive I will be as simple and concise as possible to enable you to comprehend.
?
Just to ensure we are on the same page I assume you are familiar with the term "browser." However, if you are not, that is perfectly fine. A browser is essentially an application that allows you to access the internet. Some common examples include Google Chrome, Firefox, Vivaldi, Safari, Opera, Edge, etc.
?
When we type www.google.com and press enter, many processes are triggered enabling us to access the information in Google websites. Fortunately, all these actions happen within a split second, so you hardly have time to ponder them. Before I delve into the individual steps involved and expound on them, let me provide you with a brief overview of all the processes that occur within those few microseconds.
The computer sends a request to the domain name system (DNS) server, which functions as an address book for all domain names. The DNS server then returns the precise IP address of the server that is pointed to https://www.google.com. This is very similar to what happens when you save a phone number with your chosen name, for example, ‘Mary’. When you dial Mary, you are actually dialing the unique phone number and not the name Marry.
?
With this IP address, your computer then creates a connection with the server via the IP address. This connection type is called TCP (Transmission Control Protocol), and your computer can establish this connection through the IP (Internet Protocol). This entire process is known as the "handshake."
?
In most cases, the request process goes through a verification process via a firewall that authorized the request before granting access. Additionally, if the server you are attempting to access is also behind a firewall, a similar check is conducted before connecting to the server.
?
Once the connection is established, your browser sends a request for the webpage using a security protocol like SSL (Transport Layer Security) or TLS (Transport Layer Security) to encrypt the data which is exchanged between your computer and the server. This encryption is responsible for the "s" in "https" (Hypertext Transfer Protocol Secure), indicating a secure connection is established.
?
For Companies with high traffic, a load balancer receives the requests and sends them to a particular server depending on the algorithm. The request from your browser will therefore first hit the load balancer before they forward it to different servers.
The server sends a response back to the load balancer which also forwards the response back to your browser. This response will mostly include HTML, CSS, and JavaScript files that makeup Google's homepage.
Our browsers are designed in such a way that they understand the 0’s and 1’s (computer language) which are interpreted to form our beautiful web page.
?
Domain Name System (DNS) Request
Whenever you enter a domain name or website on your browser, (e.g www.google.com) the browser saves the DNS record in its cache to see if there is a recent copy of the DNS record for that domain, the browser uses the IP address in the cache to send a request to the server. This speeds up the process of converting the domain name to an IP address because it bypasses the need to send a request to the DNS server.
Nevertheless, if the browser cache does not have a recent copy of the DNS record or if the DNS record has been updated since the last time it was cached, the browser sends a request to the DNS server to convert the domain name to an IP address.
This is a complex process; here are some of the stages involved;
DNS Lookup Process
The browser sends a request to the local DNS resolver, that is provided by the internet service provider (ISP). The local DNS resolver checks its cache for the most recent copy of the DNS record for the domain. If it has it, it sends the IP address back to the browser. If the local DNS resolver does not have the most recent copy of the DNS record, it sends a request to a root nameserver. The root nameserver replies with the address of a top-level domain (TLD) nameserver, such as .com
·????????The local DNS resolver sends the request to the TLD nameserver.
·????????The TLD nameserver gives back the address of the authoritative nameserver for the domain.
·????????The local DNS resolver sends a request to the authoritative nameserver.
·????????The authoritative nameserver responds with the IP address for the domain.
·????????The local DNS resolver sends the IP address back to the browser.
·????????The browser sends a request to the server at the IP address to retrieve the webpage.
The duration for which the DNS record is cached (known as the "TTL" or "Time To Live") is determined by the authoritative nameserver and can be customized by the domain owner.
?
TCP/IP connectivity
TCP (Transmission Control Protocol) and IP (Internet Protocol) are two of the primary protocols that make up the Internet. They work together to establish a link between a client and a server and facilitate the exchange of data between them. When you input "google.com" into a web browser, the browser employs TCP/IP to establish a link with the server that hosts the website.
·????????The browser uses IP to send a request to the server to establish a connection.
·????????The server receives the request and sends a message back to acknowledge the connection, popularly called the handshake procedure.
·????????When the connection is established, the browser can use TCP to send a request for the webpage (e.g google.com).
领英推荐
·????????The server receives the request and sends the HTML code for the homepage of google.com back to the browser using TCP to ensure dependable transmission. HTML codes are the framework on which webpages are formed.
?
·????????Other resources (such as images, styling, etc) that the webpage requires are also received via TCP/IP.
FIREWALL
Before any data transmissions occur, the firewall determines if the request is legitimate or not. The firewall is a security mechanism that protects against any malicious attack.
Therefore the security system monitors and controls the incoming and outgoing network traffic based on predetermined security rules
When you type a URL like "google.com" into your browser, the request that your browser makes to Google's server passes through the firewall on its way. The firewall checks the incoming request to make sure it is allowed based on its security rules.
There are two main security rules that a firewall uses:
1.??Rules that allow or block?traffic based on the source and destination?of the request. For example, a firewall may be configured to block all traffic from certain countries or to allow only certain IP addresses to access the network.
2.??Rules that allow or block?traffic based on the type of traffic. For example, a firewall may be configured to block all traffic on certain ports (such as those used by malware) or to allow only certain types of traffic (such as HTTP or HTTPS).
?
HTTPS/SSL
HTTPS (Hypertext Transfer Protocol Secure) is a safe version of HTTP, which is used to transmit data on the internet. It encrypts the data sent between your browser and Google's server.
?
SSL (Secure Sockets Layer) and TLS (Transport Layer Security) are encryption protocols that ensure the safety of data transmitted over HTTPS.
?
When your browser connects to Google's server using HTTPS, it agrees with Google's server on the version of SSL/TLS to use and creates a secure, encrypted channel for data transmission.
HTTPS?can be likened to a locked container used to send messages securely over the internet. The message in the locked container can only be accessed by the rightful recipient.
SSL/TLS?are special codes used to lock and unlock the box. When you use HTTPS to send a message, you and the recipient agree on the code to use to lock and unlock the box. This way, only you and the recipient know the access code and can read the message.
?
When you enter "google.com" into your browser, the server hosting google.com is the recipient. The browser sends a request for the webpage using HTTPS, which is like putting the request in a locked container and sending it to the server. The server then sends the webpage back to the browser using HTTPS, which is like putting the webpage in a locked container and sending it back to the browser.
?
?
Load-balancer
A load balancer is a tool that distributes incoming network traffic across a group of servers or resources to ensure optimal performance. Its main function is to ensure that the traffic is distributed evenly across the servers to prevent overloading any single server and to increase the overall capacity and reliability of the system.
?
Google, receives billions of website requests every day and requires many servers to serve all these users. Therefore, they need to set up a load balancer to ensure even distribution to servers. When a browser tries to access google.com, the load balancer receives the incoming request from the browser and forwards it to one of the servers in the Google server network. The server chosen will depend on the type of load-balancing algorithm implemented.
?
Web Server?
A web server is a software or hardware that is in charge of managing requests for web pages from clients (such as a browser attempting to access google.com). When a client sends a request for a web page to a website server, the server handles the request and returns the appropriate response to the client.
This means that Google's server will obtain a request from the load balancer when attempting to access google.com.
The web server would then handle the request and produce a response, back to the user.
The website server would then send this response back to the load balancer, which would forward it to the browser. The browser would then use the HTML, CSS, and JavaScript files to display the web page for the user.
?
Server for Applications and Database
The application server handles dynamic content. When using "google.com," the application server will be responsible for producing the search results (which change based on the query you input into the search engine).
?
When a query is sent to Google, it hit the balancer, which forwards it to one of the web servers in the Google server network. The web server then sends the request to the application server, which handles the request and produces the search results. Depending on the complexity of the query, the application server may need to request a database to retrieve the necessary data for the user.
In conclusion, when you type www.google .com multiple processes, though very take place before the needed information is brought back to the user. From resolving the domain name via DNS to retrieving and processing the requested data and searching through the database, each step is vital to ensuring that the correct information is given back to the user.