How Websites Work: Domain, Hosting and Files

When you type a web address and a page appears, several systems work together in the background. A domain gives the site a memorable name. DNS helps the browser find the right service. A web server responds to the browser’s request, and the browser assembles the returned files into a page. This guide explains how websites work in plain English, with enough detail to understand the roles of domains, hosting, and files.
The main parts of a website
A typical website visit involves a client, a server, an internet connection, DNS, a protocol for exchanging messages, and the site’s files or application. The client is the visitor’s device and browser. The server is the computer or software that stores a site or handles its requests. Web hosting provides the infrastructure or service used to make a website available. If you need the basic definition first, read what web hosting is.
What happens when you open a website?
1. The browser reads the address
You enter a URL such as https://example.com/about. The URL includes more than a domain: the protocol tells the browser how to connect, the domain identifies the host name, and the path names the requested page or resource. The exact parts vary, but this address tells the browser what you want to open.
2. DNS helps find the service
The browser or the device asks a DNS resolver for information associated with the hostname. DNS is the Domain Name System, which helps translate human-readable names into information internet-connected systems can use to locate services, commonly IP addresses. A resolver may already have a cached answer; otherwise it follows the DNS lookup process. DNS records can point to a hosting provider, a website platform, or another network service. See Cloudflare’s DNS explanation for more about the lookup and caching process.
3. The browser makes a secure connection and sends a request
After locating the service, the browser establishes a network connection and sends an HTTP request. On an HTTPS site, TLS helps encrypt the connection and authenticate the site using its certificate. For a closer look at the certificate itself, see our SSL certificate guide. The request asks for a particular resource, such as the page at /about. The server may respond directly, or software on the server may process the request first.
4. The server finds or builds the response
For a simple static site, the server can return a stored file. For a dynamic site, such as many WordPress installations, server-side software may read the requested route, run code, retrieve content from a database, and create a response. The response can include a status code, HTML, and links to other resources. A “not found” response, for example, means the requested path did not lead to the expected page; the server may still be working normally.
5. The browser requests the page’s other files
The first response may refer to stylesheets, scripts, images, fonts, and other resources. The browser requests those files too. HTML describes page structure, CSS controls presentation, and JavaScript can add behavior. Image and video files are assets rather than markup, but they are part of what the visitor sees or uses.
6. The browser assembles and displays the result
The browser processes the received code and resources, lays out the page, and displays it. Some resources may arrive later or be loaded only when needed. The final experience therefore depends on the site’s code and assets, the server response, the visitor’s network and device, and any caching or delivery services involved. MDN’s guide to how the web works walks through clients, servers, DNS, HTTP, and files.
Where the domain and hosting fit
The domain is the name people remember, not the site itself. DNS settings tell the internet how to route requests for that name. Hosting supplies the server or platform that stores and serves the site. The site’s files and application determine what content is returned. These pieces can be purchased from one provider or managed separately.
Changing a DNS record does not copy your website to another host. It changes where requests for a name are directed. When moving hosts, you normally prepare the site at the destination, test it, and then update the relevant domain settings. Our existing guide on connecting a domain to Hostinger explains a common version of that connection step.
Static and dynamic websites
A static website can serve prebuilt files that stay the same until someone updates them. A dynamic website can create or customize a response when someone requests it, often by running code or consulting a database. The distinction is about how content is delivered, not whether a site looks simple or complex. A small site can be dynamic, and a large site may deliver many pages as cached or prebuilt files.
Content management systems such as WordPress make it possible to edit pages through an administrative interface. Depending on the setup, the system stores content in a database and combines it with a theme and plugins to produce a page. The host runs the relevant software, while the browser receives the response and displays it.
What caching and a CDN change
Caching keeps a copy of some content or data so it does not need to be rebuilt or fetched from the origin each time. A content delivery network (CDN) can distribute or cache selected files across locations, allowing some visitors to receive them from a nearby network edge. Neither tool replaces the domain, the website, or its hosting; they change how certain requests are served. Setup and results depend on the site and service configuration.
A simple way to troubleshoot a page that will not load
- Check the address. A typo or incorrect path can request a page that does not exist.
- Check the domain connection. If you recently changed DNS, verify the records and nameservers at the registrar or DNS provider.
- Check the hosting service. Confirm the account is active and the server or site platform is responding.
- Check the site itself. A missing file, plugin error, broken route, or database problem may affect the application even when DNS works.
- Check HTTPS. A certificate problem can prevent secure access or trigger a browser warning.
These are different layers, so identify where the failure occurs before changing settings. If the site loads on its own domain but a new domain does not, the DNS connection is a sensible place to investigate. If only one page fails, the path or application may be the issue instead.
Frequently asked questions
Does the browser download the whole website?
The browser requests the page and the resources it needs. Some files may load later, be reused from cache, or be requested only when required, so a visit does not always download every file associated with a site.
What does DNS do when a website loads?
DNS helps resolve a domain or hostname so the browser can find the relevant internet service. It does not store or transfer the website’s pages by itself.
Where are website files stored?
They are stored on a hosting server or website platform. A dynamic site may also store content and settings in a database, while some assets may be served through caching or a CDN.
What is the difference between a browser and a server?
The browser runs on the visitor’s device and requests pages. The server stores or processes site content and sends responses back to the browser.
Does changing DNS move a website?
No. Changing DNS directs a domain to a different service. The files or application must be copied or set up at the destination separately before you switch the domain.
The bottom line
A website visit is a conversation: the browser reads a URL, DNS helps it locate the service, the server returns a response, and the browser assembles the page from code and assets. The domain, hosting, DNS, application, and browser each do a different job. Knowing that separation makes it easier to choose hosting and diagnose problems without changing the wrong setting.
For the domain-management details behind this process, read our guides to domain registrars and web hosts, DNS records and caching, changing nameservers, and transferring a domain.




3 Comments