[DNS Fundamentals Part 12] DNS Design Exercises: AD Domain Names, Site Migration, Hybrid DNS, Outage Response, and a Domain Review

DNS Fundamentals Part 12 DNS Design Exercises: AD Domain Names, Site Migration, Hybrid DNS, Outage Response, and a Domain Review DNS

“I understand how it works, but how do I think about it in an actual design?”

We have reached the final part of the series. From Part 1 to Part 11, we looked at how DNS works, how to run it, how to investigate it, how to protect it, how to use it in the cloud, and how to troubleshoot it. This last part is a set of design exercises for using all of that in real situations.

We have prepared five problems. Each is based on a situation you really do run into in the field. Before you look at the model answers, please try thinking them through on your own first.

▶ This part is also available as a YouTube video (about 21 min) (it is also embedded at the end of this article).


How to work through the exercises

Diagram of the four steps: read the problem and mark the requirements; think alone for five minutes and write your pick and the reason; share in a group and compare with others' picks; read the model answer and notes to check the deciding requirement
  1. Read the problem: Mark the requirements, and assume any conditions that aren’t stated
  2. Think for five minutes: Write down the option you choose and why. If you can, also write down the steps you would use to verify it with dig
  3. Compare: If you can share with colleagues or your team, compare your answer with others’
  4. Read the model answer and notes: Check which requirement was the deciding one

There is more than one correct answer. The option you choose changes depending on which requirements you weigh most heavily. The first thing to do is to confirm the requirements and the current state. For conditions the problem doesn’t state (team structure, budget, future expansion), say explicitly how you assumed them. It is more important to be able to name the requirement that decided your choice than to match the answer.


Question 1: Choose a domain name for a new internal AD

Diagram showing four conditions (cloud integration with Microsoft 365, mixed devices of Windows, Mac, and Linux servers, certificates with TLS for internal websites, and a registered domain, example.com) and three candidates: 1. corp.local, 2. corp.internal, 3. ad.example.com
  • Situation: A company with 300 employees is creating a new AD forest. There is no existing AD, and it plans to integrate with Microsoft 365 (Entra ID)
  • Current state: The company has already registered example.com, and uses it for web and email (the authoritative DNS is an external DNS service)
  • Candidates: 1. corp.local 2. corp.internal 3. ad.example.com
  • Environment: In addition to Windows, the company has Macs and Linux servers, and wants to use TLS certificates for its internal websites

Points to consider: How clients resolve names, how certificates are issued, integration with the cloud, and preparing for the future (mergers and company name changes)

Question 1: Model answer and notes

Table comparing A corp.local, B corp.internal, and C ad.example.com on four criteria (no clash with mDNS, public certificates, Entra ID integration, unique name), showing that C meets all of them
OptionStrengthsWeaknesses
A corp.localShort, and the same as old procedure documents.local is used for mDNS (RFC 6762), so it may not resolve on Macs and Linux. Public certificates cannot be obtained. Microsoft also advises against it
B corp.internalReserved by ICANN for internal use (2024), so it does not clash with Internet namesPublic certificates cannot be obtained, so an internal CA is needed. Entra ID integration requires a separate UPN suffix. A clash with the same name at a merger partner can still happen
C ad.example.comA domain you own, so it is unique. Follows Microsoft’s recommendation. More certificate optionsThe name is a little long. You must take care not to create the same name in the external DNS

The deciding factors are these three: integration with the cloud, the mix of Macs and Linux, and certificates. Option C, which satisfies all of them, is the strongest. Option B is a choice when the environment is closed and completely separated from the outside, and you can operate an internal CA.

An AD domain name is extremely hard to change later, so decide it fully at the start (Part 2). If it is a subdomain of a domain you own, clashes, certificates, and integration are all taken care of.


Question 2: Migrate a website to a different server

Diagram showing authoritative DNS where the A records for example.com and www are 198.51.100.10 with TTL 86400, a switch from the old server (on-premises) to the new environment (cloud) 203.0.113.20 next Saturday night, and some people who looked up the new name static.example.com in testing
  • Situation: You are migrating the company website (example.com and www.example.com) from an on-premises server (198.51.100.10) to a new environment in the cloud (203.0.113.20)
  • Current state: The TTL of the A records is 86400 seconds (1 day). The company manages its own authoritative DNS (one primary, one secondary)
  • Requirements: Keep downtime as short as possible, and do the switch next Saturday night. If there is a problem, you must be able to revert immediately
  • Additional: The new environment will also start using the name static.example.com. There is no record yet, but it seems a few people looked it up as a test

Points to consider: When and to what value to lower the TTL, how long to keep the old server, preparing the new name, and how to roll back

Question 2: Model answer

Diagram comparing, by the length of the band during which old answers still arrive, A: just rewriting on the day (up to 1 day still reaching the old server), B: lowering the TTL to 300 two days before (reaching the new environment after about 5 minutes), and C: B plus forwarding from the old server to the new one (even users with old answers reach the new environment)
OptionWhat it involvesStrengthsWeaknesses
ALeave the TTL as is, and rewrite the A record on the dayFew stepsTraffic keeps reaching the old server for up to 1 day. Rolling back takes just as long
BLower the TTL to 300 seconds at least 2 days before, rewrite on the day, and restore the TTL once things are stableThe switch and the rollback take effect in minutes. No extra costNeeds advance work. Some caches ignore the TTL, so keep the old server for a while
CIn addition to B, make the old server a forwarder (reverse proxy) to the new environment after the switchUsers holding old answers also reach the new environment, so there is effectively no downtimeA more complex setup. Certificates, logs, and handling of source IPs must be considered separately

The basic choice is Option B, and for sites that cannot tolerate downtime, add Option C. If you use a cloud DNS service, you can also move traffic to the new environment gradually with weighted routing (Part 10). With any option, create the static.example.com record first.

Question 2 notes: the migration timeline

Timeline: one week before, prepare the new environment and certificate and create the static record; two days before, lower the TTL from 86400 to 300; on the day, change A to 203.0.113.20 and verify on every NS; for a few hours, watch the old server's access logs; one week later, stop the old server and set the TTL back to 3600
WhenTaskPurpose / check
1 week beforePrepare the new environment and certificates, and create the record for static.example.comMake sure an earlier NXDOMAIN does not linger in negative caches
2 days before (earlier than the old TTL of 86400 seconds)Lower the TTL of example.com and www to 300 (increment the serial)Wait for old caches stored with the 1-day TTL to expire
Day (Saturday night)Change the A record to 203.0.113.20 and verify on every NSEliminate differences between NSs with dig @each-NS name +norec (Resolve-DnsName -NoRecursion -Server)
A few hours after the switchWatch the old server’s access logsCaches that ignore the TTL and long-lived connections remain
1 week laterIf there are no problems, stop the old server and set the TTL back (for example, to 3600)Restore it only once rollback is no longer possible

The biggest pitfall is that the act of lowering the TTL itself does not take effect until the old TTL has elapsed (Part 7). “We lowered the TTL yesterday, so we’re fine” is not true.

For static.example.com, the caches of the people who looked it up in testing still hold “does not exist.” Negative caching lasts for the smaller of the SOA TTL and MINIMUM, so create the record early (Part 3).

Also, if you are moving the DNS service itself (the NS records), consider the TTL of the NS records in the parent zone as well, and run the old and new zones in parallel with identical content.


Question 3: Mutual name resolution between on-premises and AWS

Diagram showing an on-premises AD domain corp.example.com with two DC-plus-DNS servers, connected by Direct Connect and VPN to AWS Tokyo with a shared services account and three workload accounts (with more to come) and a private hosted zone aws.corp.example.com, with queries needed in two directions
  • Situation: The on-premises AD domain corp.example.com (two servers that are both DC and DNS) is connected to the AWS Tokyo Region with Direct Connect and VPN. AWS has one shared services account and three workload accounts, each with its own VPC
  • Requirement 1: On-premises clients must be able to resolve AWS internal systems (*.aws.corp.example.com, a private hosted zone)
  • Requirement 2: To join EC2 (Windows) instances to AD, the VPCs must be able to resolve corp.example.com
  • Requirement 3: You do not want to operate more servers just for DNS. The workload accounts are expected to keep increasing

Points to consider: Which components go in which account, how to distribute the rules, and how to prevent loops and ensure redundancy

Question 3: Model answer

OptionWhat it involvesStrengthsWeaknesses
APlace Resolver inbound and outbound endpoints in the shared services account, and share the forwarding rule for corp.example.com with the workload accounts through RAM (or Route 53 Profiles). On-premises, conditionally forward aws.corp.example.com to the inbound endpointNo servers to operate. As accounts grow, you only need to associate the ruleEach endpoint IP is charged. Settings are split between on-premises and AWS
BRun DNS servers (BIND, Unbound, etc.) on EC2 and perform conditional forwarding in both directionsFine-grained control. Costs are predictableServers need redundancy, updates, and monitoring, which conflicts with Requirement 3
CPlace DCs on AWS (EC2 or AWS Managed Microsoft AD) and specify them as DNS in the VPC’s DHCP optionsAD join and DNS are handled in one place. AD keeps working even if the line goes downNames for private hosted zones and VPC endpoints require a separate setting to forward from the DC to the VPC Resolver
Architecture diagram: the shared services account holds the inbound and outbound endpoints and the forwarding rule; 1. aws.corp.example.com is forwarded from the on-premises DNS to the inbound endpoint, 2. corp.example.com is forwarded from the outbound endpoint to the on-premises DNS, and the rule is shared with the workload accounts

Requirement 3 makes Option A the strongest. Option C is less a DNS approach than a way of thinking about AD redundancy, and can be combined with Option A.

Question 3 notes

Diagram showing three points: only one direction per name to prevent loops; the forwarding rule wins over a private hosted zone for the same name, so split the AWS side into a child domain; and two of everything (AZs, on-premises DNS, links), tested link by link

The deciding factors are the requirements “don’t add DNS servers” and “accounts keep increasing.” In Option A, you gather the endpoints in the shared services account and share the forwarding rule with the other accounts. The VPCs that the rule is associated with do not need to be connected to each other over the network.

There are three points to watch.

  1. Loops: Make the directions one-way: on-premises sends aws.corp.example.com to AWS, and AWS sends corp.example.com to on-premises
  2. Priority: For the same name, the forwarding rule wins over the private hosted zone, so split the AWS side into a subdomain. However, the forwarding rule for corp.example.com also applies to its subdomains by default, so it is safer to exclude aws.corp.example.com from forwarding with a system rule (see the system rule in the section “Resolver endpoints and forwarding rules” in Part 10)
  3. Redundancy: Place endpoints in two or more AZs, register both on-premises DNS servers as forwarding targets, and test by stopping one side of each link in turn

You can also integrate through NS record delegation (delegation rules) (Part 10). Before connecting, tabulate the direction and redundancy for each name; this makes gaps in the design easier to spot.


Question 4: “Only some users can’t open the site”

Diagram showing three people at HQ and two remote workers on VPN who cannot open the site, going through two HQ caching DNS servers, while people at the Osaka office and on smartphone connections can, going through Osaka's caching DNS or a mobile carrier's DNS, and the partner's authoritative DNS that migrated from the old service to the new service last weekend
  • Situation: On Monday morning, the help desk received five reports that “the partner’s portal portal.example.org won’t open.” The browser shows “Server IP address could not be found”
  • Reporters: Three people at headquarters and two remote workers using VPN. People at the Osaka office and on smartphone connections can open it
  • Internal setup: There are two caching DNS servers (BIND) at headquarters and one at the Osaka office, and both resolve external names themselves starting from the root. VPN users use the headquarters caching DNS
  • The partner announced that “we migrated our DNS service last weekend”

Points to consider: What to check and in what order, what the possible causes are, and what to tell the partner

Question 4: Model answer and notes

OptionWhat it involvesStrengthsWeaknesses
AAsk users to clear their clients’ caches or reboot—If the cause is on the caching DNS side, it will not fix it. It also does not reveal the cause
BStarting from what the affected people have in common (the HQ caching DNS), compare the HQ and Osaka caching DNS and the partner’s NSs in turn with dig (Resolve-DnsName on Windows)Identifies the cause and gives you evidence to show the partnerTakes effort and requires dig knowledge
CClear the whole cache on the HQ caching DNS, or reboot itMay fix it temporarilyAffects the entire company and destroys the evidence of the cause. Will not fix it if it is a DNSSEC problem
Diagram of the procedure: the reports share only people using the HQ caching DNS, so compare dig @HQ-DNS and dig @Osaka-DNS, check the EDE and +cd, then check the partner's NSs with dig +trace and dig @each-NS +norec; for EDE 22, flush only the old NS from the cache; for EDE 9, ask the partner to fix the DS

The answer is Option B. This is the classic example of “only some people can’t resolve it” from Part 11.

  1. What the reports share: Only people using the HQ caching DNS (the two VPN users also use the HQ DNS)
  2. Compare dig @HQ-DNS and dig @Osaka-DNS (SERVFAIL vs NOERROR)
  3. Check the EDE and +cd
  4. Check the partner’s NSs with dig +trace and dig @each-NS +norec
  • With EDE 22 (No Reachable Authority), it is highly likely that only HQ has cached the old service’s NSs, and the old service no longer answers. Remove only the relevant part with rndc flushtree example.org
  • With EDE 9 (DNSKEY Missing), the DS was not updated. Ask the partner to fix the DS (Part 9)

Option C, “clear everything and reboot,” sometimes fixes things, but it destroys the evidence of the cause too. Keep the evidence and narrow down the location of the cause one stage at a time.


Question 5: Review the DNS settings for your own domain’s email and web

Diagram showing example.com's email (12 SPF includes, DKIM only partly, DMARC at p=none with reports going to a person who has left), web (no CAA record), a leftover CNAME (campaign2019 pointing to a cloud service), and domain renewal (paid with the predecessor's card, notices sent to the predecessor)
  • Situation: You are reviewing the DNS settings for your company’s domain example.com for the first time in several years. The person in charge has changed many times
  • Email: SPF has 12 include: entries. DKIM signing is done only by some sending services. DMARC is still at p=none, and the reports are sent to the address of someone who has left
  • Web: There are no CAA records. CNAMEs for finished campaigns, such as campaign2019.example.com, are still pointing to cloud services
  • Domain: Renewal is paid with a credit card in the predecessor’s name, and expiry notices also go to the predecessor’s address

Points to consider: What to tackle first (in order of risk), how to strengthen authentication without stopping email, and how to manage things from now on

Question 5: Model answer

OptionWhat it involvesStrengthsWeaknesses
ASwitch DMARC to p=reject right away, and trim SPF to only the senders that seem to be in usePrevents spoofing immediatelyLegitimate senders you haven’t identified stop being delivered
BFirst handle the domain renewal and clean up the CNAMEs; for email, take inventory of senders from DMARC reports, then strengthen in stagesCauses no incidents, and addresses risks in order of severityTakes several weeks to several months to complete
CHand over management of DNS entirely to an outside vendorReduces in-house effortThe company cannot tell what is configured, so the same problems are likely to recur
Staircase diagram addressing risks from largest to smallest: 1. move domain renewal to a corporate name with auto-renewal; 2. delete unused CNAMEs; 3. fix the DMARC report address and inventory senders; 4. tidy SPF and DKIM and move DMARC gradually to reject; 5. add CAA

Option B is the strongest. Domain expiry and CNAME takeover lose the web, email, and the company’s credibility all at once, so deal with them first. For email authentication, first find out about the legitimate senders you must not stop, then strengthen. The order is: fix what cannot be undone first, and tighten email only after you know the senders.

Question 5 notes: a review checklist

ItemState after the reviewReason
Domain renewalA corporate name and auto-renewal. Notices go to a shared address. The registrar account uses multi-factor authenticationIf it expires, web and email both stop, and a third party can acquire it (Part 9)
Unused CNAMEsDelete CNAMEs whose targets no longer exist, and record an owner and an end date in a register when you create themIf someone else takes over the target, your subdomain can be hijacked (Part 9)
SPFTake inventory of senders and keep DNS lookups to 10 or fewerExceeding 10 makes SPF evaluation return an error (RFC 7208)
DKIMSign with your own domain’s key in every sending service2048-bit keys are recommended. Also clean up unused selectors
DMARCSend reports to a shared address, and strengthen in stages: none → quarantine → rejectStandardized as RFC 9989 in 2026 (the pct tag was removed)
CAAAllow only the CAs you use with issue, and specify a contact with iodefFrom March 2026, CAs also perform validation for domains with DNSSEC enabled

We covered how to write the records in Parts 5 and 6, and takeover and domain expiry in Part 9. This review also helps you meet the sender guidelines of the major email providers (from 2024).


Closing the series

How were the five problems? In every one of them, what mattered was not whether you knew the answer, but whether you could say “which requirement was the deciding one” and “which DNS am I asking, and what?“

Over 12 parts, we have looked at DNS from how it works to how to investigate it, protect it, and use it in the cloud. DNS is something people don’t usually notice, but when it stops or returns a wrong answer, every kind of communication stops at the front door. We hope this series helps you stay calm and isolate the problem the next time someone says “something seems to be wrong with DNS.”

As a first step, run dig +trace on your own PC and follow the delegation of a name you use every day. We think you will see things differently from before.

Thank you for reading to the end.


Watch the video

This part is also explained in a YouTube video (about 21 min).

All parts of the series are in the DNS Fundamentals playlist on YouTube.

The DNS Fundamentals series (12 parts)

All 12 parts with a reading guide: DNS Fundamentals

  1. What Is DNS? How Name Resolution Works and Its Three Key Players
  2. The domain name hierarchy and delegation
  3. How name resolution works
  4. DNS messages and transport
  5. Resource records, part 1
  6. Resource records, part 2
  7. Running authoritative DNS servers
  8. Investigating with commands
  9. DNS security
  10. DNS in the cloud and on corporate networks
  11. DNS troubleshooting
  12. DNS design exercises (this article)

This series is the English edition of 【DNS入門】, originally written in Japanese.

コメント

Copied title and URL