Domains & DNS Basics
> Goal: point your domain to your server *correctly* and understand why it sometimes “works for you but not for others.”
1) What you're trying to do
Make both:
- `yourdomain.com`
- `www.yourdomain.com`
open your website reliably.
2) The chain (domain → DNS → server)
1. User types a domain in a browser.
2. DNS turns the domain into an IP address.
3. The browser connects to the IP on port 80/443.
4. Your server answers with the site.
3) Decide where DNS is hosted (this is critical)
- Your **registrar** is where you purchased the domain.
- Your **DNS host** is where your nameservers point (Cloudflare, registrar DNS, hosting provider DNS, etc.).
- You must edit records at the **DNS host** (authoritative nameservers).
4) The most common website setup (recommended for beginners)
A) Point the root domain
- Record: **A**
- Name/Host: `@`
- Value: your server IPv4 (example: `203.0.113.10`)
B) Point www
- Record: **CNAME**
- Name/Host: `www`
- Value/Target: `@` (or `yourdomain.com` depending on the DNS UI)
5) TTL & propagation (why it takes time)
- DNS answers are cached by resolvers (ISPs, corporate networks, routers).
- **TTL** controls how long caches keep the old answer.
- During changes/migrations, set TTL low (e.g., 300–900s). After it's stable, increase it (e.g., 3600–86400s).
6) Quick verification checklist
1. Does `yourdomain.com` resolve to the expected IP?
2. Does `www.yourdomain.com` resolve the same way?
3. Is the server reachable on **80** (HTTP) and **443** (HTTPS)?
4. Does the site respond with the correct domain (virtual host)?
7) Common mistakes (90% of beginner issues)
- DNS edited in the wrong place (nameservers point elsewhere).
- IP is wrong (old server, wrong VPS, wrong load balancer).
- Using both A and CNAME for `www` (many DNS providers disallow).
- Firewall/security group blocks port 80/443.
- The domain is pointed correctly but the server isn't configured for that domain.
8) Troubleshooting flow (fast)
1. Confirm authoritative DNS host (nameservers).
2. Confirm record values (A for `@`, CNAME for `www`).
3. Confirm reachability: 80/443 open to the internet.
4. Confirm web server config: the domain is added and serving content.
9) Best practices
- Keep an inventory of DNS records (especially for email: SPF/DKIM/DMARC).
- Change one thing at a time, then verify.
- Prefer CNAME for `www` so you don't duplicate IPs everywhere.
What to learn next
- 2026-01-18—Initial or baseline update for this page.