Sub topic 3
Choosing a Kind of Web Hosting
Assume you know what an IP address is and can use a command line. You should also understand that DNS maps names to services, while hosting runs the service.
Compare hosting options
Hosting determines who manages the server, how much control you have, and how resources are shared.
| Hosting type | Best fit | Main trade-off |
|---|---|---|
| Shared | Small, low-traffic sites | Low cost, limited control |
| VPS | Applications needing server control | You manage more operations |
| Dedicated | Consistent high capacity | Expensive and harder to operate |
| Static hosting | Files, documentation, frontend sites | No built-in server-side runtime |
| Platform-based | Apps needing managed deployment | Provider-specific limits and pricing |
Choose static hosting for generated files. Choose a platform when you want builds, scaling, and certificates managed for you. Choose a VPS or dedicated server when custom software or predictable control matters.
Point the domain at the host
You can delegate DNS to a provider by changing the domain's nameservers at the registrar. Alternatively, keep the current nameservers and add records such as A, AAAA, or CNAME according to the host's instructions. Do not add conflicting records for the same name. The apex domain and www may require separate settings.
Serve the site over HTTPS
HTTPS uses TLS to encrypt browser traffic and authenticate the host. Enable the hosting provider's certificate feature, then ensure DNS points to that provider. A certificate for example.com does not always cover every subdomain. Redirect HTTP to HTTPS after the certificate works.
> callout warning > Do not use a certificate before DNS points correctly. Certificate validation will fail or may issue for the wrong service.
Troubleshoot with `dig`
Query the record type you expect:
dig example.com A +short
dig www.example.com CNAME +short
dig @1.1.1.1 example.com A
dig +trace example.comCompare authoritative results with recursive resolver results. If they differ, caching or delegation is often the cause. Check the hosting provider's required record name and value exactly.
Protect the domain and email
Enable registrar lock and multi-factor authentication. Use DNSSEC when your registrar and DNS provider support it. For email, publish SPF to identify permitted senders, DKIM to sign messages, and DMARC to specify how receivers handle failures.
Exercise
You host a static site and receive a provider target hostname for www. Which DNS record normally connects www to that target?
Show answer
A CNAME record, unless the provider specifically requires an A or AAAA record.