Web Hosting vs Domain Names Explained
In this article
When you build a website, two separate services work together behind the scenes: a domain name and web hosting. The domain name is the address people type to find you (like example.com), while web hosting is the physical or virtual server that stores your site’s files and delivers them to visitors. Neither works without the other in practice, but they are bought, renewed, and managed independently. Understanding the difference helps you troubleshoot problems, avoid overpaying, and make informed decisions when setting up a site.
What a Domain Name Actually Is
A domain name is a human-readable label that maps to a server’s numeric IP address. Every device connected to the internet has an IP address, such as 192.0.2.1, but remembering strings of numbers for every site is impractical. The Domain Name System (DNS) acts as a phonebook: when you type example.com, your browser queries DNS servers, which return the corresponding IP address, and then your browser connects to that server.
Domain names are structured in levels. The rightmost part is the top-level domain (TLD), such as .com, .org, or .net. To the left is the second-level domain, usually the name you chose (like “example” in example.com). Subdomains, like blog.example.com, sit further left and can point to different servers or sections of the same site.
Domains are not owned outright. You register them for a period (typically one year, but up to ten) from an accredited registrar. If you stop renewing, the domain eventually becomes available for someone else to register. The registration is managed by ICANN, the nonprofit that coordinates the global DNS, but the actual sale is done through private companies.
What Web Hosting Provides
Web hosting is the service that stores your website’s files—HTML, CSS, images, databases, and scripts—on a server connected to the internet. When someone visits your domain, their browser sends a request that reaches your hosting server, which then sends back the files needed to render the page.
There are several types of hosting, differing mainly in resources and control:
- Shared hosting: Your site lives on a server with many other websites, sharing CPU, RAM, and disk space. It’s cheap and easy, but performance can suffer if a neighbor gets heavy traffic.
- VPS (Virtual Private Server): A physical server is split into virtual machines, each with guaranteed resources. More control and better isolation than shared, at a higher cost.
- Dedicated hosting: You rent an entire physical server. Maximum performance and customization, but expensive and requires technical knowledge to manage.
- Cloud hosting: Your site runs on a network of virtual servers that can scale up or down on demand. Good for variable traffic, but pricing can be unpredictable.
- Managed WordPress hosting: A specialized shared or cloud plan optimized for WordPress, often with automatic updates, backups, and caching.
Hosting companies also provide the server software (like Apache or Nginx), security features, and technical support. Some offer email hosting tied to your domain, such as you@example.com.
How They Connect: DNS and Nameservers
The link between a domain and hosting is made through DNS records, specifically nameservers. When you register a domain, you can set its nameservers to point to your hosting provider—for example, ns1.hostingcompany.com. Those nameservers contain the actual DNS records that tell browsers where to find your site.
The most common record is the A record, which maps a domain to an IPv4 address, or AAAA for IPv6. A CNAME record maps a subdomain (like www) to another domain name, which then resolves to an IP. MX records direct email to the correct mail server.
Here is the typical sequence when someone visits your site:
- The browser asks a DNS resolver for the IP address of your domain.
- The resolver queries the root and TLD servers to find your domain’s nameservers.
- It queries your nameservers, which return the IP address of your hosting server.
- The browser connects to that IP and requests your web page.
- The hosting server sends the files, and the browser renders them.
This process is usually instant, but DNS changes can take up to 48 hours to propagate worldwide because many resolvers cache results.
Buying Them Separately vs. Bundled
Most hosting providers offer a free domain for the first year when you sign up for a plan. This is convenient, but it ties your domain to your hosting account. If you later switch hosts, you must either transfer the domain or update its nameservers—a simple task, but one that confuses many beginners.
Buying the domain separately from a dedicated registrar gives you more flexibility. You can keep the same domain even if you change hosting providers, email services, or website builders. It also avoids the risk of losing your domain if your hosting account is suspended for any reason. Registrars like Namecheap, GoDaddy, and Cloudflare offer domains without requiring hosting.
One common misconception is that you must buy hosting from the same company as your domain. That is false. You can register a domain at one company and host at another, as long as you update the nameservers. The only exception is if you use a website builder like Wix or Squarespace, where the domain and hosting are tightly integrated, but even then you can often connect an external domain.
Common Problems and How to Diagnose Them
When a site goes down, the first question is whether the problem is the domain or the hosting. Here are typical scenarios:
- “Site not found” or DNS error: The domain’s nameservers are wrong, the domain has expired, or DNS hasn’t propagated yet. Check your domain registrar’s dashboard for expiration status and nameserver settings.
- Site loads but shows an error page: The domain resolves, but the hosting server is misconfigured or down. Try accessing the site directly via its IP address or a temporary URL provided by your host.
- Email works but website doesn’t: This usually points to a hosting issue, since email and web can be on different servers. Check if your hosting plan includes email and whether those servers are separate.
- Domain expired: If you forget to renew, the site stops working entirely. Most registrars have a grace period, but after that the domain may be released.
To diagnose, use the command-line tool nslookup or online DNS checkers to see what IP your domain resolves to. Then compare that to the IP provided by your hosting company. If they match, the issue is likely on the hosting side.
Costs and Renewal Pitfalls
Domain prices vary by TLD and registrar. Standard .com domains typically cost $10–$15 per year, while newer TLDs like .io or .ai can cost $30–$80. Hosting costs range from about $3–$10 per month for shared plans to $50–$200 for VPS or dedicated servers. Cloud hosting is often pay-as-you-go.
The biggest pitfall is the introductory pricing model. Many hosts advertise a low monthly rate for the first term, then renew at a much higher price—sometimes two to three times the original. Always check the renewal price before signing up. Similarly, a “free domain for a year” often renews at the regular price, and if you don’t want it, you must cancel the auto-renewal.
Another trap: domain registrars sometimes charge extra for WHOIS privacy (hiding your personal contact info from public DNS records). Some include it free, others charge $5–$10 per year. Always read the checkout page carefully.
Do You Need Both? Alternatives and Edge Cases
Technically, you can have a website without a domain name by using the hosting server’s IP address or a subdomain provided by the host (like yoursite.hostingcompany.com). But that is impractical for branding and trust. Similarly, you can own a domain without hosting, but then there is no website to serve—the domain can be used for email forwarding or parked as an investment.
If you use a website builder like Wix, Squarespace, or Shopify, the hosting is included in your subscription. You don’t manage servers or DNS; the platform handles it. You still need a domain, but you can buy it through the builder or connect one you already own.
For a simple personal site, a static site host like GitHub Pages or Netlify offers free hosting, but you still need to buy a domain if you want a custom address. In that case, you’re combining a paid domain with free hosting—a common and valid setup.
Frequently Asked Questions
Can I buy a domain without hosting?
Yes. You can register a domain and leave it unused, or use it for email forwarding, a parked page, or to redirect to a social profile. No hosting is required until you want to serve a website.
Do I need to buy hosting and domain from the same company?
No. They are independent services. You can register your domain at one registrar and host your site at another. You just need to point the domain’s nameservers to your hosting provider.
What happens to my domain if I cancel hosting?
Your domain remains active as long as it’s registered and renewed. Canceling hosting only removes the files and server space. You can later point the domain to a new host by updating nameservers.
Why does my website show “This site can’t be reached” right after I set up hosting?
Most likely DNS hasn’t propagated yet. Changes to nameservers can take up to 48 hours to spread across the internet. Meanwhile, you can often preview your site via a temporary URL from your host.
Is a free domain from a hosting provider worth it?
It’s convenient, but you’re usually locked into that host for at least a year. If you later switch, you may need to transfer the domain, which can take a few days. Buying separately gives you more freedom.
What’s the difference between domain forwarding and DNS pointing?
Domain forwarding redirects visitors from one URL to another (e.g., example.com to example.net), often using a 301 redirect. DNS pointing changes the actual server address via records like A or CNAME. Forwarding is for redirects; pointing is for hosting.