Amazon Route 53
A managed, authoritative DNS — plus a domain registrar and a health-check engine. Its real job on the exam isn't "name → IP"; it's deciding which IP to answer with: closest region, healthy endpoint, weighted split, by geography. The name is a nod to the DNS port, 53.
Một DNS có thẩm quyền, quản lý sẵn — kèm đăng ký domain và một bộ máy health-check. Việc thật của nó trong đề không phải "tên → IP"; mà là quyết định trả về IP nào: region gần nhất, endpoint khỏe, chia theo trọng số, theo địa lý. Tên "53" là nhắc tới cổng DNS 53.
Two exam pillars stand out: the Alias record (the AWS-native answer to "point the root domain at an ELB/CloudFront") and the routing policies (simple, weighted, latency, failover, geolocation, geoproximity, multi-value, IP-based) — usually wired to health checks for automatic DNS failover. Then Route 53 Resolver handles hybrid DNS with on-premises.
Hai trụ cột trong đề nổi bật: bản ghi Alias (đáp án AWS-native cho "trỏ root domain vào ELB/CloudFront") và routing policy (simple, weighted, latency, failover, geolocation, geoproximity, multi-value, IP-based) — thường gắn với health check để tự failover DNS. Rồi Route 53 Resolver lo hybrid DNS với on-premises.
Records — the four you must recogniseBản ghi — bốn loại phải nhận ra
A hosted zone is a bag of records. Each record has a name, a type, a value, and (usually) a TTL. Only four types show up on this exam. Một hosted zone là một túi các record. Mỗi record có tên, loại, giá trị, và (thường) một TTL. Chỉ bốn loại xuất hiện trong đề.
A
Maps a hostname → IPv4. e.g. example.com → 54.22.33.44.Ánh xạ hostname → IPv4. Ví dụ example.com → 54.22.33.44.
AAAA
Maps a hostname → IPv6.Ánh xạ hostname → IPv6.
CNAME
Maps a hostname → another hostname (must have its own A/AAAA). Not at the zone apex.Ánh xạ hostname → hostname khác (đích phải có A/AAAA riêng). Không ở zone apex.
NS
Name servers for the hosted zone — they control how traffic is routed for the domain.Name server của hosted zone — chúng điều khiển cách định tuyến traffic cho domain.
DNS only tells the client where to go; the client then talks to the resource directly. Route 53's cleverness is entirely in which value it returns.
DNS chỉ nói cho client biết đi đâu; sau đó client tự nói chuyện thẳng với tài nguyên. Cái khôn của Route 53 nằm hết ở chỗ trả về giá trị nào.
Alias vs CNAME — the apex trapAlias vs CNAME — bẫy ở apex
AWS resources give you an ugly hostname (lb1-1234.us-east-2.elb.amazonaws.com) and you want mydomain.com to point at it. A CNAME can do it for a subdomain but not the root. An Alias is the Route 53-only record that works at the root, is free, and tracks the target automatically.
Tài nguyên AWS cho bạn một hostname xấu (lb1-1234.us-east-2.elb.amazonaws.com) và bạn muốn mydomain.com trỏ vào đó. CNAME làm được cho subdomain nhưng không cho root. Alias là record riêng của Route 53, dùng được ở root, miễn phí, và bám theo target tự động.
| CNAME | Alias | |
|---|---|---|
| Points toTrỏ tới | any hostnamebất kỳ hostname | an AWS resourcetài nguyên AWS |
| Root / apex (mydomain.com)Root / apex (mydomain.com) | ✗ non-root only (something.mydomain.com)✗ chỉ non-root (something.mydomain.com) | ✓ root and non-root✓ cả root lẫn non-root |
| CostChi phí | charged as a querytính như một query | free of chargemiễn phí |
| TTLTTL | you set itbạn tự đặt | set automatically by Route 53Route 53 tự đặt |
| Health checkHealth check | —— | nativenative |
| Record typeLoại record | CNAMECNAME | an A / AAAA flagged "Alias"một A / AAAA gắn cờ "Alias" |
example.com, with no subdomain prefix) must carry the zone's mandatory SOA and NS records — they're what define the zone's existence. But a CNAME forbids any other record of a different type at the same name (RFC 1034 / 2181). CNAME + mandatory SOA/NS = a contradiction, so the standard bans it. On a subdomain like www.example.com there's no forced SOA/NS, so CNAME is fine there.
Đây là luật của chuẩn DNS, không phải giới hạn của AWS. Zone apex (tên root trần, example.com, không có tiền tố subdomain) bắt buộc phải mang record SOA và NS của zone — chúng định nghĩa sự tồn tại của zone. Nhưng CNAME cấm mọi record loại khác ở cùng một tên (RFC 1034 / 2181). CNAME + SOA/NS bắt buộc = mâu thuẫn, nên chuẩn cấm. Ở subdomain như www.example.com không có SOA/NS bắt buộc, nên CNAME thoải mái.
Alias sidesteps the whole problem: it's an A/AAAA record (not a CNAME), so it lives happily beside SOA/NS at the apex while Route 53 resolves the target to IPs server-side.
Alias né trọn vấn đề: nó là record A/AAAA (không phải CNAME), nên sống hòa bình cạnh SOA/NS ở apex, còn Route 53 resolve target ra IP ở phía server.
| ProviderNhà cung cấp | Name for itTên gọi | Under the hoodBản chất |
|---|---|---|
| Route 53 | AliasAlias | A/AAAA flagged Alias; resolves the AWS resource server-sideA/AAAA gắn cờ Alias; resolve tài nguyên AWS phía server |
| Cloudflare | CNAME FlatteningCNAME Flattening | you type a CNAME at the root; it flattens to A/AAAA on the serverbạn gõ CNAME ở root; server "làm phẳng" thành A/AAAA |
| DNSimple | ALIASALIAS | same idea — resolve target, return A/AAAAcùng ý tưởng — resolve target, trả về A/AAAA |
| DNS Made Easy · NS1 | ANAMEANAME | same idea — resolve target, return A/AAAAcùng ý tưởng — resolve target, trả về A/AAAA |
Routing policies — the exam's centre of gravityRouting policy — trọng tâm của đề
"Routing policy" here means how Route 53 picks the answer to a query — it does not route traffic itself. Match the scenario keyword to the policy. Most can attach health checks; Simple can't. "Routing policy" ở đây nghĩa là Route 53 chọn câu trả lời cho query như thế nào — nó không tự định tuyến traffic. Khớp từ khóa của tình huống với policy. Đa số gắn được health check; Simple thì không.
| PolicyPolicy | Picks the answer by…Chọn câu trả lời theo… | Health check?Health check? |
|---|---|---|
| SimpleSimple | one resource (or multiple values, client picks one at random)một tài nguyên (hoặc nhiều giá trị, client chọn ngẫu nhiên) | ✗ no✗ không |
| WeightedWeighted | % split across resources (70/20/10) — canary, blue-green, region balancingchia % giữa các tài nguyên (70/20/10) — canary, blue-green, cân region | ✓ yes✓ có |
| LatencyLatency | lowest latency between user and AWS Region (not geography!)latency thấp nhất giữa user và Region AWS (không phải địa lý!) | ✓ yes✓ có |
| FailoverFailover | active-passive: primary while healthy, else secondaryactive-passive: primary khi khỏe, hỏng thì secondary | ✓ mandatory✓ bắt buộc |
| GeolocationGeolocation | user location (continent / country / US state) — add a Defaultvị trí user (châu lục / quốc gia / bang Mỹ) — thêm Default | ✓ yes✓ có |
| GeoproximityGeoproximity | location of users and resources, shiftable by bias — needs Traffic Flowvị trí user và tài nguyên, dịch được bằng bias — cần Traffic Flow | ✓ yes✓ có |
| Multi-ValueMulti-Value | returns up to 8 healthy records — not a substitute for an ELBtrả về tối đa 8 record khỏe — không thay được ELB | ✓ yes✓ có |
| IP-basedIP-based | client's IP / CIDR → a chosen endpoint (e.g. route an ISP's users)IP / CIDR của client → endpoint đã chọn (vd định tuyến user của một ISP) | ✓ yes✓ có |
Failover is the one policy where a health check is required — the whole point is to stop answering with the primary once it fails.
Failover là policy duy nhất mà health check bắt buộc — cả mục đích là ngừng trả về primary khi nó hỏng.
Geoproximity ≠ Geolocation. Geolocation routes purely by where the user is; geoproximity also weighs where the resources are and lets you tilt the split with a bias. That bias knob is the exam tell — and it only works through Traffic Flow.
Geoproximity ≠ Geolocation. Geolocation định tuyến thuần theo user ở đâu; geoproximity còn cân nhắc tài nguyên ở đâu và cho bạn nghiêng tỉ lệ bằng bias. Cái núm bias đó là dấu hiệu trong đề — và chỉ chạy qua Traffic Flow.
Hosted zones — public vs privateHosted zone — public vs private
A hosted zone is a container of records for a domain and its subdomains. Public zones answer names on the internet; private zones answer names inside your VPCs (e.g. db.example.internal) and are invisible to the outside world.
Hosted zone là container các record cho một domain và subdomain của nó. Zone public trả lời tên trên internet; zone private trả lời tên trong VPC của bạn (vd db.example.internal) và vô hình với bên ngoài.
Same records concept, two audiences. Public = the internet resolves it; private = only the associated VPC(s) resolve it. A private zone that "doesn't resolve" is almost always the two VPC DNS flags being off.
Cùng khái niệm record, hai đối tượng. Public = internet phân giải được; private = chỉ VPC được gắn phân giải được. Private zone "không phân giải" gần như luôn là do hai cờ DNS của VPC bị tắt.
enableDnsHostnames and enableDnsSupport = true, or the private hosted zone won't resolve.VPC phải bật enableDnsHostnames và enableDnsSupport = true, nếu không private zone sẽ không phân giải.
Health checks — the engine behind failoverHealth check — bộ máy phía sau failover
Health checks are what let DNS fail over automatically. Three kinds: endpoint checks (HTTP/HTTPS/TCP to a public target), calculated checks (combine other checks), and CloudWatch Alarm checks (the escape hatch for anything private). They're integrated with CloudWatch metrics. Health check là thứ để DNS tự failover. Ba loại: check endpoint (HTTP/HTTPS/TCP tới target public), check calculated (gộp các check khác), và check CloudWatch Alarm (cửa thoát cho mọi thứ private). Chúng tích hợp với metric CloudWatch.
The cross-region DB failover shape: a health check (endpoint or CloudWatch Alarm) → alarm → event/SNS → Lambda that promotes the read replica and rewrites the Route 53 record. Route 53 is the piece that redirects clients to the new primary.
Dáng failover DB xuyên region: health check (endpoint hoặc CloudWatch Alarm) → alarm → event/SNS → Lambda để promote read replica và ghi lại record Route 53. Route 53 là mảnh chuyển hướng client sang primary mới.
Route 53 Resolver — hybrid DNS with on-premRoute 53 Resolver — hybrid DNS với on-prem
Inside a VPC, the Route 53 Resolver (the .2 address) already answers for EC2 local names, private hosted zones, and public names. Hybrid DNS is making that resolver and your on-premises DNS resolve each other's names, over Direct Connect or VPN. Two endpoints do it.
Trong một VPC, Route 53 Resolver (địa chỉ .2) đã trả lời cho tên local của EC2, private hosted zone, và tên public. Hybrid DNS là làm cho resolver đó và DNS on-premises phân giải tên của nhau, qua Direct Connect hoặc VPN. Hai endpoint làm việc này.
Direction is everything. Inbound = on-prem asks AWS (green, into the VPC). Outbound + Resolver Rules = AWS asks on-prem (orange, out of the VPC), forwarding a matched domain to a target IP.
Hướng là tất cả. Inbound = on-prem hỏi AWS (xanh lá, đi vào VPC). Outbound + Resolver Rules = AWS hỏi on-prem (cam, đi ra khỏi VPC), chuyển tiếp domain khớp tới một target IP.
| Rule typeLoại rule | Does whatLàm gì |
|---|---|
| Conditional forwarding (Forwarding Rules)Conditional forwarding | Forward queries for a domain and all its subdomains to specified target IPs (your on-prem resolvers).Chuyển query cho một domain và mọi subdomain tới các target IP (resolver on-prem của bạn). |
| System RulesSystem Rules | Selectively override a forwarding rule (e.g. "don't forward acme.example.com").Chọn lọc ghi đè một forwarding rule (vd "đừng chuyển acme.example.com"). |
| Auto-defined System RulesAuto-defined System Rules | Built-in resolution for AWS internal domains & private hosted zones (compute.amazonaws.com, ec2.internal).Phân giải sẵn cho domain nội bộ AWS & private hosted zone (compute.amazonaws.com, ec2.internal). |
If several rules match, Route 53 Resolver takes the most specific. Resolver Rules can be shared across accounts with AWS RAM — manage them centrally in one account and reuse from many VPCs. Nếu nhiều rule khớp, Route 53 Resolver lấy cái cụ thể nhất. Resolver Rule có thể chia sẻ xuyên account bằng AWS RAM — quản lý tập trung một account rồi dùng lại từ nhiều VPC.
Things that catch you outNhững chỗ dễ sập bẫy
-
CNAME can't sit at the apex. To point
mydomain.com(root) at an ELB/CloudFront/S3, you must use an Alias. CNAME is only forwww.mydomain.comand other subdomains. CNAME không đặt ở apex. Để trỏmydomain.com(root) vào ELB/CloudFront/S3, phải dùng Alias. CNAME chỉ chowww.mydomain.comvà subdomain khác. - No Alias to an EC2 DNS name. Alias targets are managed AWS resources (ELB, CloudFront, API GW, S3 website, …). For a bare EC2 instance, use a plain A record to its IP. Không Alias tới tên DNS của EC2. Đích Alias là tài nguyên AWS quản lý (ELB, CloudFront, API GW, S3 website, …). Với EC2 trần, dùng A record trỏ IP.
- Latency ≠ geography. Latency-based routing sends you to the Region with the lowest RTT, which is not always the nearest country. If the requirement is "users in country X must hit endpoint Y", that's Geolocation. Latency ≠ địa lý. Latency-based đưa bạn tới Region có RTT thấp nhất, không phải luôn là nước gần nhất. Nếu yêu cầu là "user ở nước X phải vào endpoint Y", đó là Geolocation.
- Geoproximity needs Traffic Flow. The bias knob only exists in Route 53 Traffic Flow. If a question mentions bias/shifting load between regions, it implies Traffic Flow + geoproximity. Geoproximity cần Traffic Flow. Núm bias chỉ có trong Traffic Flow của Route 53. Nếu đề nhắc bias/dịch tải giữa region, tức là Traffic Flow + geoproximity.
- Health checkers are public. They can't reach a private or on-prem endpoint — route through a CloudWatch Alarm health check instead. Also: open your security group/NACL to the checker IP ranges, or every check fails. Checker là public. Chúng không tới được endpoint private hay on-prem — thay bằng health check qua CloudWatch Alarm. Và: mở security group/NACL cho dải IP checker, nếu không mọi check đều fail.
- Simple routing has no health check. If you list multiple values under Simple, a dead one can still be returned. Need health-aware multiplexing? Use Multi-Value. Simple routing không có health check. Nếu liệt kê nhiều giá trị dưới Simple, một cái chết vẫn có thể được trả về. Cần multiplex có biết health? Dùng Multi-Value.
-
Private zone won't resolve? Almost always the VPC is missing
enableDnsHostnames/enableDnsSupport. And DNSSEC only works on public zones. Private zone không phân giải? Gần như luôn do VPC thiếuenableDnsHostnames/enableDnsSupport. Và DNSSEC chỉ chạy trên public zone.
Exam reflexesPhản xạ khi thi
| The question says…Đề nói… | AnswerĐáp án |
|---|---|
| "Point the root domain at an ELB / CloudFront / S3 website""Trỏ root domain vào ELB / CloudFront / S3 website" | Alias record (not CNAME)Alias record (không phải CNAME) |
| "Send X% of traffic to a new version / blue-green / canary""Gửi X% traffic sang bản mới / blue-green / canary" | Weighted routingRouting Weighted |
| "Lowest-latency region for each user""Region latency thấp nhất cho mỗi user" | Latency-based routingRouting Latency-based |
| "Automatic active-passive DR failover via DNS""Tự failover DR active-passive qua DNS" | Failover routing + health checkRouting Failover + health check |
| "Serve different content by user's country/continent""Phục vụ nội dung khác theo nước/châu lục của user" | Geolocation (+ a Default record)Geolocation (+ record Default) |
| "Shift more load to a region with a bias""Dịch thêm tải sang một region bằng bias" | Geoproximity via Traffic FlowGeoproximity qua Traffic Flow |
| "Health-check a private / on-prem endpoint""Health-check endpoint private / on-prem" | Health check on a CloudWatch AlarmHealth check trỏ vào CloudWatch Alarm |
| "On-prem must resolve AWS private names""On-prem phải phân giải tên AWS private" | Resolver Inbound endpointResolver Inbound endpoint |
| "AWS must resolve on-prem names""AWS phải phân giải tên on-prem" | Resolver Outbound endpoint + Resolver RulesResolver Outbound endpoint + Resolver Rules |
| "Return several healthy IPs, no ELB""Trả về vài IP khỏe, không ELB" | Multi-Value (up to 8)Multi-Value (tối đa 8) |