DNS hygiene notes for a zero-trust network
Nathan Chadwick · · 8 min read · Updated
Listen
TLDRRead the short version
- Log DNS at the resolvers you run, and keep the logs long enough to investigate. An NXDOMAIN burst is a signal after you have a baseline, not a page on day one.
- Block known malware and phishing names first. Newly registered domains need an exception path with an expiry, or the block will be switched off.
- Stop clients choosing their own resolver. Outbound DNS, DNS-over-TLS, and browser DNS-over-HTTPS are how the logs go quiet.
- Internal zones are for devices you trust. Guest and IoT networks should not be able to resolve the domain controllers.
- When DNS fails, Windows still asks the local subnet. Turn off LLMNR and NetBIOS name resolution.

Two views of the same names#
DNS looks like a phone book until you watch what asks it. A laptop, a printer, a guest phone, and a domain controller can all be pointed at one resolver that answers for the public internet and for _msdcs. That resolver is then a map of your internal names, handed to anything that can send it a packet.
Zero trust, applied here, is dull. Devices you trust get the internal view. Devices you do not trust get a filtered public resolver and nothing else. You log the resolver you operate, because that is the only place the query is guaranteed to exist. And you do the filtering in an order that the service desk can live with, or they will ask you to turn it off, and you will.
The short version of this post was visibility, NXDOMAIN, and aligning internal zones with device trust. This is that, plus the bypasses that make the logs a lie.
Log the resolver, not every laptop#
Turn query logging on at the resolvers you control. The useful fields are small: when, which client, which name, which response code, which resolver answered. Ship them off the resolver. A log on the domain controller's disk is the log you lose when the domain controller is the incident.
The Windows DNS client log on every endpoint is the wrong primary. It is noisy, it is often not enabled, and a client that has been told to use DNS-over-HTTPS never writes the query you hoped to see.
Keep the logs for as long as the investigations you actually run. If you would look back six weeks for a mailbox compromise, six days of DNS is the gap you will swear at. NCSC's logging and protective monitoring guidance is the right standard to argue for retention. You do not need a new platform to start. You need the resolver you already run, forwarding somewhere you can search.
Unexpected NXDOMAIN bursts are worth a detection, and they are worth a baseline first. A host that suddenly asks for hundreds of names that do not exist can be a domain-generation algorithm, a broken update client, or your DNS suffix search list appending corp.example.com to every query the browser makes. The third one is very common and very loud. Watch it for a fortnight. Alert on a client that is wildly above its own normal, not on the first NXDOMAIN of the day. The bursts that precede something worse still show up. The ones that are a misconfigured suffix become a ticket you fix once.
Long labels, huge TXT queries, and a client that talks to one odd name thousands of times are the later detection: tunnelling. The logs make it possible. They do not have to page someone in week one.
Block the names that are rarely legitimate#
A protective DNS service refuses to resolve names that are already known to be malicious. NCSC runs one for organisations that can join it. CISA runs one for US federal agencies. Everyone else buys the same idea from a firewall, a secure web gateway, or a filtering resolver. The product is a procurement choice. The behaviour is the control: known-bad names do not resolve, and the block is logged.
Roll the categories out in an order that does not create a ticket factory.
- Malware and phishing first. A legitimate line-of-business app almost never lives on a domain in those feeds. Turn the block on, and read the hits daily for a week.
- Command-and-control and newly seen malware infrastructure next, if your feed splits them out. Same habit: read what you blocked.
- Newly registered domains and "uncategorised" last, and maybe never as a hard block. CDNs, a marketing agency, and a supplier you onboarded yesterday all look like this. Log them. Alert on a spike. If you do block them, the exception path needs an owner and an expiry, or the block list becomes the place people park permanent allows. I treat that list the way I treat Conditional Access exclusions: no owner, no date, no exception.
A block page that shows the name, and a way to request access, saves the "the internet is down" ticket. Review the top blocked names weekly for the first month. You will find one integration you forgot, and you will find the feed doing its job. Both are useful. A block with no review gets disabled the first time the director's new tool fails.
The client that never asks you#
Logging and filtering only see the queries that reach your resolver. A surprising amount of modern DNS is designed not to.
- Another resolver on purpose. DHCP said 8.8.8.8, or a user set it, or an IPv6 router advertisement handed out DNS you do not operate. If you only configured IPv4, you do not control DNS.
- DNS-over-TLS on 853, straight to a public resolver, past a firewall that only thought about port 53.
- DNS-over-HTTPS on 443. The Windows DNS client can use DNS over HTTPS to a resolver you choose, which is fine when that resolver is yours. Chrome, Edge, and Firefox can also do DoH to a resolver you do not run, inside HTTPS, looking like any other web traffic.
The practical cuts:
- Block outbound UDP and TCP 53, and TCP 853, except from your resolvers (and from anything that is explicitly a forwarder). Clients should not speak DNS to the internet.
- Set the Windows DoH policy so managed clients use your resolver, or do not use DoH at all until you can see it.
- Set the browser policy. An unmanaged browser template that points at a public DoH server undoes the rest.
- For the device you will never fully manage, assume the laptop resolver is hostile to your policy. The control that still works is the one in the session. I wrote about DNS Protection hung off an enterprise browser in the office is a browser tab. A known-bad name can die before the page paints, even when the device DNS is something else.
A determined person on a machine you do not own will get around this. The goal is that a managed device, by default, cannot.
Internal names for devices you trust#
Split-horizon DNS is normal. corp.example.com answers on the inside and does not answer the same way on the public internet. The mistakes are specific.
Do not publish the inside. Public DNS should not contain your domain controllers, your _msdcs records, or RFC1918 addresses for internal hosts. A zone transfer, a stale public record, or a certificate transparency log is enough for someone off the network to draw the map. Scavenge stale records in Active Directory DNS so a recycled address is not still a server's name.
Do not give every VLAN the inside view. Guest Wi-Fi and IoT get a resolver that forwards to the protective service and has never heard of the domain controllers. Corporate VLANs get the internal zones by DHCP. Remote devices get them when they are on the VPN or the ZTNA client, via the suffix search list that connection pushes, and not via a public record "so it works without the VPN". That last shortcut is how internal names leak.
This is the device-trust point. Conditional Access does not speak DNS, but the population should be the same idea: a joined, compliant device is allowed the internal view, and an unknown device is not. Flat internal DNS that mirrors the public internet, and answers it for anyone who can hit the resolver, throws that away. The printer network does not need to resolve the file server. If casting from a phone to a TV is the reason the networks were left flat, segment them and poke the specific holes, which is what I did with UniFi, guest, IoT, and AirPlay.
Conditional forwarders for a partner are fine. A forwarder that sends your internal queries to their resolver, or theirs into yours without a reason, is not. Write down each one.
The name resolution that is not DNS#
When DNS fails, Windows still tries to help. LLMNR and NetBIOS name resolution ask the local subnet, and anything on that subnet may answer. That is a credential-theft path, MITRE T1557, and it does not care that your upstream resolver is excellent.
Turn both off on managed Windows devices. The setting is a policy, not a hope that DNS will always work. After you disable them, the things that break are the things that were never in DNS. Add the record. Do not turn LLMNR back on to save a printer.
A short checklist#
- Query logging on the resolvers you operate, forwarded somewhere you can search, retained for the length of a real investigation.
- NXDOMAIN and volume detections based on a baseline, not on the first missing name.
- Malware and phishing categories blocked. Newly registered domains logged, and blocked only with an exception that expires.
- Outbound 53 and 853 allowed only from your resolvers. DoH and browser policies set on managed devices. IPv6 DNS included.
- Internal zones absent from the public DNS. Guest and IoT resolvers unable to answer them.
- Remote clients given the internal view only over VPN or ZTNA.
- LLMNR and NetBIOS name resolution disabled. The gaps fixed with DNS records.
- Top blocked names reviewed weekly for the first month.
Closing#
DNS hygiene is not a new appliance. It is deciding which devices are allowed to know your internal names, refusing the names you already know are bad, and keeping the log of what was asked.
Do the blocks that rarely hurt a real application. Give every other block an expiry. And assume that a resolver you do not operate, including the one inside a browser, is a gap until policy says otherwise. The helpdesk will live with a filter that explains itself. They will not live with one that breaks a supplier every Tuesday and offers no way to say so.
References#
Sources and further reading for the claims above.