Chapter 9: Domain Names, DNS and Subdomains
Mitranno, so far we have opened our websites with http://13.233.10.25. It works, but nobody will remember that number, and you can't put it on a visiting card. In this chapter we give our server a real name like example.com, add www, create subdomains like blog.example.com and api.example.com, and understand what happens behind the scenes when someone types that name. We'll use GoDaddy as the registrar example because many of you already have an account there, but the steps are almost the same on Namecheap, Hostinger, BigRock or Route 53. Chala, apla server la nav deuya (let's give our server a name)!
You type example.com
|
v
+-------------+ 1. "IP of example.com?" +----------------+ 2. root servers
| Browser / | ------------------------> | DNS resolver | 3. .com TLD servers
| OS cache | <------------------------ | (recursive) | 4. authoritative NS
+-------------+ 6. "13.233.10.25" +----------------+ (GoDaddy / Route 53)
| ^
| 7. HTTP GET Host: example.com | 5. A example.com = 13.233.10.25 (+ TTL)
v |
+-------------------------------+ +------------------+
| EC2 (Elastic IP 13.233.10.25) | | Authoritative NS |
| Nginx/Apache: server_name | +------------------+
+-------------------------------+
Concepts in this chapter
- 9.1What is a domain name?
- 9.2How DNS resolution works
- 9.3DNS record types you must know
- 9.4Before you point a domain: prepare the server
- 9.5Buying a domain on GoDaddy
- 9.6Pointing a GoDaddy domain to EC2 (GoDaddy DNS)
- 9.7Alternative: GoDaddy registrar + Route 53 DNS
- 9.8Configure the web server for the domain
- 9.9Verify DNS: dig, nslookup and friends
- 9.10Subdomains
- 9.11HTTPS for your domain and subdomains
- 9.12Troubleshooting domains