Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
How the Internet Works  ›  Lesson

Hosting — Where the Site Lives

What is hosting? 12 minHosting keeps a site's files, and any server code, on an always-on computer, while DNS connects the separate domain name to that host.

Hosting — Where the Site Lives

The bakery's owner has bought crumbbakery.com and you have a folder of HTML, CSS and images on your laptop. Yet nobody can see the site. A domain is only a name; the files still need a home that is switched on, connected and ready to answer requests at three in the morning. That home is the host.

The rule

The domain is the name on the sign; hosting is the building behind it.

Hosting means your site's files, and any server code, live on a computer that is always on and reachable from the internet. You could serve the site from your laptop, but it sleeps, moves between networks and has a home connection that changes address. A host solves all of that for you.

Hosting comes in a few common shapes:

Kind What you get Good for
Static hosting The host serves your files exactly as they are Sites made of HTML, CSS, JavaScript and images
Shared hosting A slice of one server shared with many other sites Small classic sites, often with PHP
VPS or cloud server A whole virtual machine you manage yourself Full control, custom back ends
Platform hosting You push code; the platform builds, runs and scales it Apps with some server code, without managing machines

A frontend site like the bakery's is usually static: the browser does the work, so the host only has to hand over files. Many static hosts also spread copies of your files across a CDN (content delivery network), a set of servers around the world, so a visitor in Chennai is served from a nearby machine rather than one on another continent.

Two things join the name to the building:

  • A DNS record at the domain's DNS provider pointing crumbbakery.com at the host (an A record or a CNAME, as the host tells you).
  • A TLS certificate so the site works over HTTPS. Most modern hosts issue one for free and renew it automatically.

The shortcut

Before choosing a host, ask one question: "Does anything need to run on the server, or does it only hand out files?" Only files means static hosting. Code that must run on the server (saving orders to a database, for example) means a platform or a server.

Putting the bakery site liveStep 1 of 4
  1. Decide the kind

    The site is HTML, CSS, JavaScript and images, with no server code. Static hosting is enough.

A common confusion: buying a domain does not give you a website, and paying for hosting does not give you a name. They are separate services you connect with DNS, even when one company sells both.

Drills

Answer fast — trust the rule.

quick drill

The bakery has registered its domain but has no hosting yet. What happens when someone visits?

quick drill

The site is only HTML, CSS, JavaScript and images. Which hosting fits best?

quick drill

What is a CDN mainly for?

quick drill

The owner later wants online orders saved to a database. What changes?

Remember

  • The domain is the name on the sign; hosting is the building behind it.
  • Ask: does anything run on the server, or does it only hand out files?
  • Trap: a domain and hosting are separate; DNS connects them.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainChoosing a home

The bakery's owner asks: 'I bought the domain, so why isn't my site online, and what kind of hosting do we need?' Explain the difference between a domain and hosting, which kind of hosting suits the current site, and what would change if orders were saved to a database.