# Exercise 2: DNS Migration and Incident Questions

## Part A — Migrating a Domain to Route 53 Without Downtime

`ShopCo`'s DNS is hosted at their registrar (zone with 60 records, TTLs of 86,400 s). They want Route 53 hosting while keeping the registrar.

1. Write the step-by-step migration plan (export, import, verify, lower TTLs, change NS, monitor, rollback).
2. Which records need special care (apex records pointing to an ALB, email records, DNSSEC)?
3. How long must you wait between steps, and why?

## Part B — Incidents

For each, give the cause and the fix.

1. After deleting an old S3 static website bucket `promo.shopco.com`, a security researcher reports they could serve content on `promo.shopco.com`.
2. During a regional failover drill, Route 53 switched records within 2 minutes, but 30% of API traffic kept going to the dead region for 20 minutes. The traffic came from Java services using the AWS SDK and a long-lived HTTP client.
3. Users in Australia are routed to `us-east-1` instead of the new `ap-southeast-2` region with latency-based routing. Most of them use their ISP's resolver; a subset uses a public resolver.
4. `api.shopco.com` failover never triggers although the API returns 500s; the health check targets `/` on the ALB, which serves a static "OK" page.

## Requirements Checklist

- [ ] Migration: create zone, import records, verify answers directly against Route 53 name servers (`dig @ns-…`), lower TTLs at the old provider and wait for the old TTL, update NS at the registrar, wait for the NS TTL (often 48 h), monitor, keep the old zone until traffic moves; rollback = revert NS.
- [ ] Apex → alias records; MX/SPF/DKIM verified; DNSSEC disabled/re-established carefully during transfer.
- [ ] B1: dangling record → subdomain takeover; delete records with resources, monitor for dangling DNS.
- [ ] B2: JVM DNS caching / connection reuse ignores DNS changes; set `networkaddress.cache.ttl`, recycle connections.
- [ ] B3: latency measured per resolver network; resolvers without EDNS Client Subnet or located elsewhere skew routing; consider geolocation or verify region records/health.
- [ ] B4: health check on a static page doesn't reflect app health; use a meaningful `/healthz` or a CloudWatch-alarm-based health check (5xx ratio).
