Domain Name vs Web Hosting: What's the Difference?
A domain name is your site's address. Hosting is the computer your site lives on. Here's how the two connect, in plain words, and what each one costs.

In this guide
Think of a house. The domain name is the street address. The hosting is the land and the building. You need both for people to visit, and they’re sold separately.
The domain name is the address
A domain name is what people type into the browser. For us, it’s astrobeginner.com. You don’t own a domain forever. You rent it, a year at a time, from a company called a registrar. A .com costs about $11 to $15 a year.
The domain does one job. It tells the browser where to go. Behind the scenes, it points at a computer somewhere. That pointer is a setting you can change any time, which is why you can move your site to a new host and keep the same address.
Hosting is where the files live
Hosting is a computer that stays on all day, holding your website’s files and handing them to anyone who asks. When someone types your domain, the browser asks that computer for the page.
For an Astro site, hosting is often free. That’s because an Astro site is a static site, a folder of finished files, and serving files is cheap. Cloudflare, Netlify and GitHub Pages all do it for free.
How the two connect
- You buy a domain from a registrar.
- You put your site on a host.
- In the host’s settings, you add your domain. The host tells you a setting to change at the registrar, usually called a DNS record or nameservers.
- You make that change at the registrar. Within a few minutes to a few hours, the domain points at the host.
That’s it. We did exactly this for astrobeginner.com: the domain is at one company, the hosting is at Cloudflare, and a nameserver setting joins them. How to register and connect a domain walks through each click.
The one place people get confused
Hosting companies also sell domains. Registrars also sell hosting. The checkout pages are built to make you buy both. You can, and it’s a little simpler. But if a hosting company’s domain price is high, buy the domain elsewhere. The connection step is the same either way.
What they cost, side by side
| Domain name | Hosting | |
|---|---|---|
| What it is | Your address | The computer your files live on |
| Who sells it | A registrar | A host |
| Typical price for an Astro site | $11 to $15 a year | Free |
| Can you change it later? | Yes, with a redirect | Yes, by pointing the domain at the new host |
Where to go next
- How much does an Astro website cost?
- Best hosting for Astro
- How a website gets online, from our Start from zero series.
Frequently asked questions
Do I need to buy them from the same company?
No. Many people buy the domain in one place and host somewhere else. You connect them with a few settings. Buying both from one company is simpler, but not required.
Can I have hosting without a domain?
Yes. Your host gives you a free address like yoursite.pages.dev or yoursite.netlify.app. It works, it just isn't pretty.
Can I have a domain without hosting?
Yes. People buy a name and park it for later. Nothing shows at the address until you point it at a host.
Stuck on a step?
Check the common errors guide, look up a word in the glossary, or ask the friendly people in the official Astro and EmDash Discords. How to ask so people can help.
