"What happens when you type in a URL" is a deceptive question commonly asked in tech interviews. If you look online, there are many very detailed resources but few concise explanations of how a web browser, a server, and the general internet work together.
This is how I would explain it:
- You enter a URL into a web browser
- The browser looks up the IP address for the domain name via DNS
- The browser sends a HTTP request to the server
- The server sends back a HTTP response
- The browser begins rendering the HTML
- Once the page is loaded, the browser sends further async requests as needed.
That's really it. Here's a description in words for this site.
If I were asked to explain further I might start talking about how the server and browser connect via TCP. And we could discuss encryption via https, too.
But fundamentally, it's only 7 steps. I hope this clears up any confusion for readers.