HostingPrimer

How Web Hosting Works: A Request From Browser to Server

Posted Sep 8, 2026✓ Updated Sep 10, 2026

Web hosting works by keeping your website's files on a server that answers requests from visitors' browsers. When someone visits your site, their browser looks up your domain, connects to your host's server, asks for the page, and the server sends it back — all in well under a second. That round trip is the whole mechanism. This guide follows a single request from start to finish so you can see exactly what each part does and where the host's job begins and ends.

Step 1: the browser needs your address

It starts when a visitor types your domain or clicks a link. Their browser now needs the files that make up your page, but it does not yet know where on the internet those files live. Computers do not find each other by name; they find each other by number — an IP address like 192.0.2.10. So before anything can be downloaded, the browser has to translate your human-friendly domain name into the numeric address of the server holding your site. That translation is the first thing that happens, and it is handled by a system separate from your host entirely.

Step 2: DNS turns the name into an IP address

The browser asks the Domain Name System (DNS) for the IP address linked to your domain. DNS is essentially the internet's phone book: a distributed network of servers that store the record connecting each domain name to a numeric address. Your domain's DNS settings hold an "A record" (for IPv4) or "AAAA record" (for IPv6) that points to your host's server. The lookup usually takes a few thousandths of a second and is cached along the way, so repeat visits skip it. This is also the step that explains why moving a site can take time: when you change where a domain points, the update can take up to a day or two to spread across the world's DNS servers. The domain and the hosting are doing separate jobs here, which is the difference between a domain and hosting that trips up most beginners.

Step 3: the browser connects to the server

With the IP address in hand, the browser opens a connection to that server. For a secure site — which is nearly every site now — this includes a TLS handshake, a quick exchange that sets up encryption so the data cannot be read in transit. That handshake is what the padlock and the "https" in your address bar represent. Once the connection is open and encrypted, the browser sends an HTTP request: a short, structured message that says, in effect, "please send me the home page." The request travels across the internet to your host's data centre, where the server is waiting to answer it.

Step 4: the server finds or builds the page

Now the host's server does its work. Software called a web server — most often Nginx or Apache — receives the request and figures out how to answer it. For a simple static page, it just reads the matching file off the disk and returns it. For a dynamic site like WordPress, it does more: it runs code (usually PHP) that may query a database (usually MySQL) to pull in your posts, settings and content, assembles the finished HTML on the spot, and hands that back. This is the moment your hosting plan matters most. A faster server, more memory and good caching mean the page is built and returned quickly; an overloaded shared server or a slow database makes visitors wait. Everything a host advertises — processing power, memory, storage speed, caching — is about doing this step well.

Step 5: the response comes back and renders

The server sends an HTTP response back to the browser: the page's HTML, followed by the CSS that styles it, the JavaScript that makes it interactive, and the images. The browser reads the HTML, requests those extra files (often several at once), and assembles everything into the page you actually see. A typical page makes dozens of these little requests, which is why page "weight" — the total size of all those files — affects load time as much as the server does. When the last piece arrives and renders, the visit is complete. The whole sequence, from typing the address to seeing the page, usually finishes in a fraction of a second.

Where hosting fits in all of this

Of the five steps, your host owns steps three, four and five: it runs the server that accepts the connection, builds or serves the page, and sends the response. The domain and DNS (steps one and two) are separate services that simply point visitors to the right server. That division is the key mental model — a domain is a signpost, and hosting is the destination the signpost leads to. Understanding this makes hosting decisions much simpler: a bigger plan speeds up step four, a content delivery network speeds up step five for distant visitors, and neither has anything to do with your domain. For the full picture from the beginning, see our guide to what web hosting is.

What can slow the whole thing down

Because a page load is a chain of steps, a delay anywhere in it slows the whole thing, and knowing where the delays live tells you what actually helps. A slow first DNS lookup adds a few milliseconds, though caching hides it on repeat visits. Physical distance matters: a visitor far from your server waits longer simply because the request and response travel further, which is exactly what a content delivery network fixes by keeping copies nearer to people. The biggest variable is usually step four — how long the server takes to build the page — which is where a faster plan, more memory and good caching pay off, especially for a database-driven site. And step five depends on page weight: heavy images and lots of scripts mean more to download and assemble. None of these is about your domain; they are all about the hosting and the site itself, which is why speeding up a slow site starts with the server and the page, not the address.

How web hosting works: quick answers

What happens when someone visits my website?
Their browser looks up your domain through DNS to get the server's IP address, connects to that server at your host, and sends an HTTP request. The server finds or builds the page and sends the HTML, CSS, JavaScript and images back, and the browser assembles them into the page. The whole trip usually takes under a second.
Does the web host handle the domain lookup?
No. The domain lookup is done by DNS, which is a separate system from your hosting. Your domain's DNS settings simply point to your host's server. The host's job begins once the browser connects to its server and asks for the page.
Why do some hosted sites load faster than others?
Mostly because of how quickly the server builds and returns the page — its processing power, memory, storage speed and caching — plus how large the page's files are. A cheap, overloaded shared server or a slow database adds delay; a well-resourced plan with caching returns pages quickly. A content delivery network can also speed things up for distant visitors.
Why can it take time for a new site to appear after setup?
Usually because of DNS. When you point a domain at a new server, the change has to spread across the world's DNS servers, which can take anywhere from a few minutes to a day or two. Until it propagates, some visitors may still be sent to the old location.

New to this? Start with the basics — what web hosting is, explained — then see the types of web hosting compared side by side.