Blog

Domain vs hosting: what each one does

Ink sketch of a house key on a tag beside a small house.

A domain is your website’s name, the address people type, such as yourshop.pk. Hosting is the server that stores your website’s files and database and sends the pages to visitors. You rent the domain from a registrar, usually a year or two at a time, and you rent the hosting from a hosting company. The domain’s nameservers connect the two. A website needs both, and they can come from different companies.

This guide explains each part, shows a real lookup that reveals which company answers for each part of one domain, and covers costs, renewals and email.

What is a domain name?

A domain name is a registered name in the internet’s address book. Registering it gives you the right to use the name for as long as you keep paying, and to decide where it points. You never buy it outright. You rent it, and you renew it.

Each ending has one registry that keeps the master list of names. PKNIC runs .pk, and VeriSign runs .com, according to the IANA root zone database. You buy a name either from the registry itself, as you can with PKNIC, or from a registrar or reseller that sells names for that registry.

For DNS, the registry stores only a few facts about your domain. The most important is the list of your nameservers, the servers that hold your domain’s settings. Everything else lives on those nameservers.

What is web hosting?

Hosting is space and computing time on a server that is connected to the internet all day. For a WordPress site, the server stores the WordPress files and your uploads, runs PHP, keeps your posts and orders in a database, and answers every visitor’s request.

Hosting plans differ in the limits they set: disk space, monthly bandwidth, the number of websites and, on some plans, the number of files. Many plans also include email accounts, which is why people often mix up hosting and email. Many plans are paid yearly, and the plan renews separately from the domain.

How do a domain and hosting work together?

When someone types your domain, their device looks it up in three steps:

  1. It asks the registry for your ending which nameservers your domain uses.
  2. It asks those nameservers for the website’s address, the A record.
  3. It connects to that address, which is your hosting server, and gets the page.

Email follows the same path, except that step 2 asks for MX records, which name the servers that receive mail for the domain. Your domain is the name in step 1. Your hosting is the server in step 3. The nameservers in step 2 can belong to your host, your registrar or a separate DNS service.

What does a real lookup show?

To show this with a real example, we looked up pknic.net.pk, the website of the .pk registry itself, and asked who answers each part. We queried PKNIC’s own .pk servers directly, read the DNS records over DNS-over-HTTPS, and looked up the owner of each address in the public internet address registries.

  • Which nameservers does the domain use? PKNIC’s .pk server answered with two nameservers, greg.ns.cloudflare.com and jill.ns.cloudflare.com. So PKNIC is the registry, but a separate company, Cloudflare, runs the domain’s DNS.
  • Where is the website? Those nameservers gave two addresses, 172.66.145.129 and 104.20.38.53. The address registry lists both under Cloudflare, Inc. Visitors connect to Cloudflare’s network first, and the lookup does not show the server behind it.
  • Where does email go? The MX record names mail-001.pknic.net.pk, which points to 18.192.225.215. That address is on a different network from the website, registered to a company in Germany.

So one domain had its name registered with one organisation, its DNS and website traffic handled by a second, and its mail server on a third network. PKNIC’s own services page says it does not provide web hosting, email or DNS services to people who register domains. Even the registry’s own site uses other companies for those jobs.

You can run the same check on your own domain. Open Google Public DNS in your browser, type your domain, and look at the NS, A and MX record types one at a time.

Can you have a domain without hosting?

Yes. PKNIC’s rules say a .pk domain does not need nameservers when you register it. Many people register a name first, so nobody else takes it, and set up the website later.

A domain without hosting shows nothing. Visitors get an error, or a placeholder page from the registrar, and email to the domain bounces until something answers for it.

Can you have hosting without a domain?

Technically yes, through the server’s IP address or a temporary address from the host, but it is only useful for testing. cPanel’s email accounts documentation says accounts on temporary domains cannot edit DNS or use email services. For a real business site you need your own domain.

Should you buy the domain and hosting from the same company?

You can, but you do not have to. Each choice has a trade-off:

  • Same company. One account and one bill, and the host often connects the domain for you.
  • Separate companies. Moving to another host later means changing two nameservers, with no domain transfer. If you fall out with one company, the other part is unaffected.

Whichever you choose, register the domain in your own name or your company’s name, in an account you can log in to. Getting a domain back from someone else’s account takes their cooperation, and on .pk it also takes documents sent by post. Our guide to registering a .pk domain explains what PKNIC needs to change the registrant later.

Webstribe, for example, sells hosting only. You keep the domain where you bought it and point it at your hosting with two nameservers.

What is the difference between moving hosting and moving a domain?

People often say “move my website” for two different jobs:

  • Moving the hosting. You copy the website’s files and database to a new server, then point the domain at the new server by changing its nameservers or its A record. The domain stays registered where it was. Our guide to moving a WordPress site to a new host walks through it.
  • Moving the domain. You transfer the registration to another registrar or another account. The website does not move, and if the nameservers stay the same, visitors notice nothing. On .pk, moving a domain to another account needs original documents sent to PKNIC by post and phone verification, takes about three to four business days, and only works while the domain has not expired.

You can do one without the other. Changing hosts does not require moving the domain.

What does each one cost in Pakistan?

  • A .pk domain. PKNIC charges registrants in Pakistan Rs 2,100 a year, billed two years at a time, so Rs 4,200 per payment. Resellers charge more.
  • A .com domain. Each registrar sets its own price. Compare the renewal price, not only the first year.
  • Hosting. Usually priced per year, by plan size. Compare the renewal price, the disk space and the backups. Our checklist on what to check before you buy hosting lists the questions, and our plans page shows our own prices.

The two bills renew on different dates. Note both in your calendar. If the domain expires, the website and email stop, even if the hosting is paid. If the hosting expires, you still hold the domain, but it has nothing to show.

Where does email fit in?

An address such as [email protected] needs two things: the domain, for the part after the @, and a mail server, named in the domain’s MX records. The mail server can be on your hosting, through the email accounts in your control panel, or with a separate email service. Our guide to setting up business email on your own domain covers both.

How do you find who runs each part of your domain?

  • Who registered it, and with whom. For a .com, use ICANN Lookup. For a .pk, use the WHOIS search on PKNIC’s home page.
  • Who runs the DNS. Look up the NS records. The nameserver names usually show the company.
  • Who hosts the website and the email. Look up the A and MX records. Your host can confirm whether an address is one of its servers.

If you want to move the DNS or the website, our guide to changing nameservers shows the steps and how long the change takes.

Frequently asked questions

Is a domain the same as a website?

No. The domain is the name. The website is the files and database on a hosting server. The domain points visitors to the server through its DNS records.

Can I change my hosting and keep my domain?

Yes. Move the site to the new host, then point the domain at it by changing the nameservers or the A record. The domain stays registered where it is.

Do I have to buy the domain and hosting together?

No. They are separate services. Many site owners buy the domain from a registrar or PKNIC and the hosting from a hosting company.

What happens if my domain expires but my hosting is paid?

The website and email stop working, because nobody can find the server by name. Renew the domain to bring them back.

Which should I buy first?

The domain, if you have found a name you want, because someone else can register it first. You can add hosting later and point the domain at it.

Category:

Written by

Muhammad Dilawar

Muhammad Dilawar

Muhammad Dilawar is a WordPress developer and technical SEO specialist with over 12 years of experience building, optimizing and maintaining websites. He works with WordPress, WooCommerce, server optimization, DNS, SSL, Cloudflare, website security and performance, and is a Top Rated freelancer on Upwork.

Hosting for your WordPress site

Yearly plans in rupees, with the same price at renewal. Free SSL and daily backups on every plan.