Sub topic 9
Choosing a kind of web hosting
This chapter assumes you know what an IP address is and how a domain name resolves to one. It also assumes you can read a DNS record. Hosting is the machine, or service, that answers once DNS has sent a visitor to an address.
What a host actually provides
A web host is a computer that listens on ports 80 and 443 and returns content for requests. Hosting types differ in four ways: who runs the operating system, how many sites share the machine, how the content is produced, and how much of the work you do yourself.
The hosting type also affects DNS. It decides whether you get a dedicated IP address or share one, and whether your provider asks for an A record or a CNAME.
The main types
- Shared hosting: Many customers' sites run on one server and often share one IP address. The server tells them apart by the
Hostheader in each request (name-based virtual hosting). It is cheap and managed, but you get no root access, and a noisy neighbour can slow your site. - VPS (virtual private server): A virtual machine with guaranteed CPU, memory, and disk, and root access. You install and patch the software yourself. It usually comes with its own IP address.
- Dedicated server: A whole physical machine for one customer. It gives the most performance and isolation, and costs the most. You are also responsible for hardware failure planning.
- Static hosting: Pre-built HTML, CSS, JavaScript, and images served from storage, usually behind a content delivery network (CDN). There is no server-side code to run, so it is fast, cheap, and hard to break.
- Platform-based hosting (PaaS and site builders): You push code or use an editor, and the provider handles servers, scaling, and certificates. Addresses may change, so the provider typically gives you a hostname to alias rather than a fixed IP.
| Type | You manage | Typical IP | Best for |
|---|---|---|---|
| Shared | Content only | Shared | Small sites, blogs |
| VPS | OS and software | Dedicated | Custom stacks, moderate traffic |
| Dedicated | Everything | Dedicated | Heavy or regulated workloads |
| Static | Build output | Provider hostname or anycast | Docs, portfolios, marketing sites |
| Platform | Application code | Provider hostname | Apps that need scaling without server work |
Deciding
Start with the content. If a build step can produce every page ahead of time, static hosting is usually the simplest choice. If you need a database or server-side logic, move to a platform or a VPS. Shared hosting suits a ready-made CMS you do not want to administer. Choose dedicated hardware only when you have measured a need for it.
Common mistakes
- Buying for peak traffic you do not have. A VPS you never patch is a larger risk than a shared plan you never touch.
- Assuming a fixed IP. Platform and static hosts often change addresses. If you hard-code their IP in an A record, the site breaks when they move. Use the record type they document.
- Forgetting email. Many static and platform hosts do not run mail. Your MX records can point elsewhere without affecting the website.
- Ignoring lock-in. Check that you can export your content and move the domain's records without downtime.
- Skipping backups. On a VPS or dedicated server, backups are your job.
You can see what a host looks like from outside with the lookups you already know:
dig example.com A +short
dig www.example.com CNAME +shortAn address in the answer suggests a host with a stable IP, such as a VPS. A CNAME to a provider's hostname suggests a platform or static host.
Exercise
A team has a documentation site generated from Markdown files at build time, with no database and no user accounts. They expect traffic spikes after releases. Which hosting type fits best, and why?
Show answer
Static hosting. All pages can be built ahead of time, so there is no server code to run. A CDN can absorb traffic spikes, and there is no server to patch. A VPS would add maintenance work without any benefit for this site.