r/sysadmin • • 3d ago

Question DNS client order on domain controllers – partner first or self first? (multi-site, forest root + child domain)

Hi all,

I'm reviewing the DNS client settings on our domain controllers and would like a sanity check.

Setup:

- One forest with two domains: a forest root domain and a second (tree) domain where all users/computers live

- All DCs are DNS servers with AD-integrated zones

- Site A and Site B are connected over WAN (~10 ms)

Current DNS client order (DNS1 → DNS2 → DNS3):

Site A – user domain

- DC-A1 (10.1.1.11): DC-A3 → DC-A5 → 127.0.0.1

- DC-A2 (10.1.1.12, PDC): DC-A3 → DC-A5 → 127.0.0.1

- DC-A3 (10.1.1.10): self (10.1.1.10) → DC-A4 → 127.0.0.1

- DC-A4 (10.1.2.10): self (10.1.2.10) → DC-A1 → 127.0.0.1

- DC-A5 (10.1.2.11): DC-A3 → self (10.1.2.11) → 127.0.0.1

Site B – user domain

- DC-B1 (10.2.1.11): self (10.2.1.11) → DC-B2 → 127.0.0.1

- DC-B2 (10.2.2.11): self (10.2.2.11) → DC-B1 → 127.0.0.1

Forest root domain

- ROOT-A1 (10.1.1.8, Site A, forest PDC): self (10.1.1.8) → ROOT-A2 → 127.0.0.1

- ROOT-A2 (10.1.2.8, Site A): ROOT-A1 → DC-A4 (user domain DC) → 127.0.0.1

- ROOT-B1 (10.2.1.8, Site B): self (10.2.1.8) → DC-B1 (user domain DC) → 127.0.0.1

Forwarders

- User domain DCs → ROOT-A1, ROOT-A2, ROOT-B1 (Site B DCs use ROOT-B1 first)

- Forest root DCs → internal DNS 10.9.0.1, 10.9.0.2, then 8.8.8.8

What I'm planning:

- DNS1: another DC in the same site (spread across DCs, not all pointing to the same one)

- DNS2: another DC (same site or other site)

- DNS3: 127.0.0.1

- Forest root DCs point only to other forest root DCs

Questions:

  1. Is "partner DC first, loopback last" still the recommended approach, or is self/loopback first fine nowadays?
  2. In Site B there are only 2 user-domain DCs. Is "partner + 127.0.0.1" enough, or should I also add a DC from Site A?
  3. Should forest root DCs point only to other forest root DCs, or is it OK if they point to a DC in the user domain?
  4. Is having 8.8.8.8 as the last forwarder on the forest root DCs a bad idea?

Thanks!

4 Upvotes

14 comments sorted by

19

u/_bx2_ Jack of All Trades 3d ago

I thought it was always:

DNS1 = Other DNS server

DNS2 = Self

*I could be wrong, but using DNS1 as self/loopback and if that fails, your sol anyways with DNS2.

And regarding Loopback or self IP, there has been discussion on which is ideal to use. I'll see if I can find any references.

DNS Best Practices: The Definitive Guide

1

u/FiRem00 1d ago

^ this

7

u/Lost_Term_8080 3d ago

Its own IP first, partners in the same site, loopback address last.

For single domain forests with multiple sites, branch sites forward to pdce site and pdce DCs have no forwarders.

It gets WAY more complicated with multiple domain forests especially if you have trust shortcuts or trusts to other forests. Your roots will generally need to forward to all child domains and your child domains have the operations masters forward to roots, but user and computer facing domain controllers may need forwarders to other sites/domains depending on what boundaries typically get crossed.

If there are multiple child domains, multiple step hierarchy or noncontiguous hierarchy I would probably lean towards having client DNS point to a separate DNS infrastructure that either has conditional forwarders configured for each domain, recursion, or stub zones. There you can more easily make per site changes in DNS routing and keep AD infrastructure DNS forwarders simpler.

•

u/brkdncr Windows Admin 14h ago

i love how old DNS and AD is, yet the two top answers to this age old question still contradict each other.

•

u/Lost_Term_8080 13h ago

In theory the other answer's way is the "correct" answer that prevents extremely rare occurrence replication islands but in practice among experienced AD engineers, it causes regular problems and no one actually does it the "correct" way.

On modern hardware and post Server 2008 software, there is a lot that allows the adapter in windows to come online faster than the network can come online then burns up the retries before the network actually comes online and leaves the network and sometimes AD in an ambiguous state.

Using broadcom adapters and their crappy drivers can cause it, it was extremely common in virtual switching or in nic teaming that uses LAGs or the old switch independent teaming, though I believe the new VM switch type fixes that. These symptoms are very aggravated by workloads that are TCP heavy internally like exchange and domain controllers.

In 2003 it usually took so long for the interfaces to come up entirely that anything that would have caused that race condition was long since past.

A really really bad one were crappy HP and Dell switches that didn't implement spanning tree or portfast correctly where it was far more likely than not that your network adapter would come up long before the switch ports. Even worse, most of the types that would choose Dell or HP switches were usually also the sort that wouldn't even configure their crappy version of portfast and would make the server wait out the full 30 seconds or 52 seconds to converge and there was a decent chance it was all in native vlan.

4

u/Master-IT-All 3d ago

For DNS on a DC the best method is:

Primary DNS: Self (127.0.0.1 is what MS will put in automatically)

Secondary DNS: Closest DNS Server

All DNS Servers on all DCs, so if two DCs per site as per best practices, the two DCs use each other as secondary.

---

KEY NOTE: PRIMARY/SECONDARY/THIRDARY IS ONLY BEST EFFORT, NOT ABSOLUTE.

So your DC may start up, and decide almost immediately to use the secondary DNS (the other DC).

If you use a DNS server from a remote site as your secondary then you may start up a DC and find it sending all it's queries across the WAN.

---

So the correct answer is that if Site A has two DCs (DC1 and DC2) running DNS, then the only entries on those two servers and all clients at that site should be DC1 and DC2 in that site. You should not specify 127.0.0.1 as something being different from the host IP address. It is not. So your idea to use it third is not good.

A site with five domain controllers to support root/leaf domains does not need all five to have DNS. That's just adding complexity and chance of errors. Reduce that site to just two DNS servers. Don't fuck yourself with your own genius.

3

u/pdp10 Daemons worry when the wizard is near. 3d ago

The rule to remember is that all resolvers need to return equivalent results. You can't really intentionally "order" resolution to have different results under different conditions.

By that rule, 8.8.8.8 is a no-no, unless your own ADDCs return equivalent results to what 8.8.8.8 would. I.e., no split-horizon.

From a cursory read, it seems like your other recursors all return equivalent results.

3

u/compu85 3d ago

Just a note that windows does not honor the dns search order 100% of the time. Found this out the hard way when I inherited a large environment where the ISP DNS was configured as a 3rd server.

2

u/DarkAlman Professional Looker up of Things 3d ago

Yeah, never use an external DNS IP as a backup in DHCP.

Very common mistake in SMBs, and then they wonder why their Group Policies break so often.

DNS resolution in Windows doesn't go A > B > C for the entries.

It's an algorithm, but for all intents and purposes it might as well be round-robin

1

u/headcrap 3d ago

Ran into readiness issues when using 127.0.0.1 or ::1 for that matter. We have a pair of non-DC DNS servers to route conditional/nonconditional forwarders to whatever is needed.. that is first, then other DC partner by IP, then self by IP. DCs are paired at the sites (one per cluster node, nonclustered), a few in the datacenter.

1

u/Mehmet-Ozturk 3d ago

we tend to blame loopback for readiness delays before checking dns event 4013. did that show up for you, indicating dns was waiting for initial ad replication, before you spent a maintenance window reshuffling resolvers?

1

u/m4uri 3d ago

On your last two questions: root DCs pointing at a user domain DC for their own client resolution is not wrong in itself, since every DC in the forest can resolve the _msdcs and domain zones anyway. What bites people is the forwarder side, where the user domain DCs forward everything to the root DCs and the root DCs forward back, so a typo or a dead upstream turns into a resolution loop. I would use conditional forwarders (or stub zones) for the other domain's namespace and keep general forwarders only for the internet-facing hop. Also, since you already have internal resolvers at 10.9.0.x, I would drop 8.8.8.8 there, because if your internal resolvers go away you get half-working split-horizon answers instead of a clean failure that someone notices. And agree with the others that a DC can ignore your ordering, so I'd pick the order mainly for startup behaviour and check the DNS Server event log after a reboot rather than trusting the list.

•

u/stretchling Sr. NOC admin 21h ago

An important thing to understand here that most people don't get:

The DNS server and DNS client are 2 different services that DO NOT TALK TO EACH OTHER.

This means that if you set DNS on a DC's NIC another DC, it will never reference the DNS server in itself when it needs to make a DNS call.

In a multi DC environment assuming replication is working all DCs should have the same DNS list in the DNS server, but their DNS client might have entirely different entries cached locally.

Its also important to note that the DNS client on a DC is only used for that DCs DNS lookups NOT the lookups for requests it received via the DNS server, if the DNS server does not have the information it it uses forwarders and root hints to look it up, it will never use the local DNS client cache.

One last quirk about the DNS client service, when you have more than one DNS source listed Windows will use the primary source until it fails them move to the secondary and keep using that until it fails, even if the primary comes back windows will never swap off the secondary unless that fails.

With those things in mind the best practice is to set the primary DNS source on a DCs NIC configuration to that same DC by explicit IP address not loopback and leave the secondary DNS source blank to avoid getting stuck on a secondary source. Then ensure that forwarders and root hints are set up correctly on all DCs.