Domain name vs hosting: what's the difference?
An address versus a house — what a domain name is, what hosting is, and why you need both for a website.
On this page
- The analogy: address versus house
- What a domain name is
- What hosting is
- How they connect
- Common beginner mistakes
- FAQ
- What is the difference between a domain name and hosting?
- Do I need both a domain and hosting to launch a website?
- Can I change hosting without losing my domain?
- Is a domain a one-time purchase or a yearly fee?
- Summary
When people start a website, two terms come up immediately: domain name and hosting. They are different things that work together. This article explains both, with a simple analogy.
The analogy: address versus house
- A domain name is the address of your website:
example.com. It tells people where to find you. - Hosting is the house at that address — the server that stores your files and delivers them when someone visits.
You need both. An address without a house points nowhere; a house with no address is impossible to find.
What a domain name is
A domain is a human-readable name that maps to one or more IP addresses through DNS. You do not buy a domain outright — you register it for a period (usually one year, renewable) from a registrar. In exchange for a yearly fee, you control where that name points.
The pieces:
- Registrar — the company that manages the registration (Cloudflare, Namecheap, GoDaddy...).
- DNS records — settings that connect the domain to services:
Arecords for web servers,MXfor mail, etc. - Renewal — if you let a domain expire, someone else can register it.
What hosting is
Hosting is a server that runs your website. Different scales:
- Shared hosting — your site shares a server with others. Cheap, good for small sites.
- VPS (Virtual Private Server) — a slice of a server with dedicated resources. More control.
- Dedicated server — an entire machine for you. Maximum performance, maximum cost.
- Cloud/static hosting — files served from a global network (Cloudflare Pages, Netlify, Vercel). Often free for static sites — this site is an example.
Hosting companies also offer extras: domains registration, email, databases, backups, support.
How they connect
When someone visits example.com:
- DNS resolves the domain to the IP of your hosting server.
- The browser reaches the server, which serves your files.
- The address (domain) and the house (hosting) finish the job together.
You can change hosting without changing your domain — just point the DNS records at the new server. And you can keep a domain without hosting at all (parked), but then it serves no website.
Common beginner mistakes
- Buying hosting before a domain — fine, but you cannot launch until you have both.
- Confusing renewal fees — domains and hosting are billed separately, both yearly or monthly.
- Ignoring DNS — after migrating hosts, updates take time (TTL) to propagate.
FAQ
What is the difference between a domain name and hosting?
A domain name is the address of your website — a human-readable name like example.com that maps to IP addresses through DNS, and which you register yearly from a registrar. Hosting is the server that stores your website's files and delivers them when someone visits. You need both: an address without a house points nowhere, and a house without an address is impossible to find.
Do I need both a domain and hosting to launch a website?
Yes. The domain is what people type to reach you, and hosting is what actually serves your files. You can buy them from different companies — you just point the domain's DNS records at your hosting server. Buying hosting before a domain is fine, but you cannot launch until you have both.
Can I change hosting without losing my domain?
Yes. Hosting and domains are managed separately. To move, you point your domain's DNS records at the new hosting company's server. Because the domain and the hosting are separate, changing one does not affect the other — though after switching hosts you should remember that DNS changes take time (TTL) to propagate.
Is a domain a one-time purchase or a yearly fee?
A domain is not bought outright — you register it for a period, usually one year, and renew it yearly from a registrar. If you let the registration expire, someone else can register that name. Hosting is billed separately, yearly or monthly, depending on the plan.
Summary
A domain is your website's address, registered yearly from a registrar. Hosting is the server that stores and delivers the site. They work together through DNS, and you manage them separately — which means you can change one without losing the other.
Sources
- Cloudflare Learning Center — What is a domain name? (cloudflare.com/learning/dns/glossary/what-is-a-domain-name)
- MDN Web Docs — What is a domain name? (developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_domain_name)
Share this guide
Related guides
- How to configure DNS records: A, AAAA, CNAME, MX, and TXT explained
Configure DNS records for your domain: learn what A, AAAA, CNAME, MX, and TXT records do, when to use each, and how to verify your changes propagate correctly.
- What is a browser cache? How it speeds up websites
Where your browser stores copies of images, scripts and fonts, why cached pages load faster, and how to clear the cache or force a fresh copy.
- How browser cookies work: a plain guide
What cookies are, how session and tracking cookies differ, and what 'accept all cookies' actually means.