Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Nearly every piece of malware resolves a name before it does anything else. DNS logs capture that moment, which makes them one of the highest-value and least-collected sources in most estates.

What Is DNS Log Analysis?
Before malware beacons, exfiltrates, or downloads a second stage, it almost always asks a resolver for an address. DNS logging captures that question: which host asked, for what name, when, what came back, and whether the answer existed. Few other single sources give you a record of intent across every device on the network, including the ones you cannot install an agent on.
On Windows DNS Server, the debug log is not the answer; it is expensive and poorly structured. Use the analytical log instead, an event tracing channel introduced in Windows Server 2012 R2 with event 257 for responses, which handles high query rates with minimal overhead. On Linux resolvers, BIND query logging and the structured output from Unbound and dnsmasq all work. Zeek produces the cleanest network-level record in its dns.log, with query, type, response code, and answers in one place.
Endpoint-level collection is a useful complement, because it attributes the query to a process rather than only to an address. Sysmon event ID 22 records DNS queries with the originating image, which turns “this host looked up a suspicious domain” into “this host’s copy of wscript.exe looked it up”.
Resolver logs only work if devices use the resolver. Clients configured with public DNS, or using DNS over HTTPS, bypass your visibility entirely. Block outbound port 53 to anything except your resolvers, and control browser DoH settings through policy, or the whole collection effort is undermined by a browser default.
DNS is one of the noisiest sources in an estate, and a mid-sized organisation easily produces hundreds of millions of queries a month. Three tactics keep it affordable. Aggregate rather than store every event: for most detections, counts per host per domain per hour carry the signal. Exclude the top few hundred domains by volume after checking them, which typically removes 80% of records. And keep full detail hot for a short window and aggregates for longer, which fits the retention planning most organisations end up with.
The NCSC operates Protective DNS, a recursive resolver service delivered with Nominet that blocks resolution of domains known to be malicious. It is available to UK public sector organisations, and the broader principle has been adopted by commercial providers. Using a filtering resolver changes what your logs mean: a blocked query is both a prevented connection and a strong detection signal, and those blocks are the first place to look when hunting. Feed them into your SIEM rather than leaving them in the provider’s portal.
DNS data also pairs well with other sources. A query for a newly registered domain, followed by an outbound TLS connection to the resolved address, followed by a process creation on the same host is a far stronger case than any of the three alone, and it is a natural application for a correlation rule.
At Privia Security, DNS is among the first sources we assess in our SOC maturation services, because it is cheap to collect and frequently absent.
It makes resolver logging incomplete, which is worse than useless because the gap is invisible. Clients using DoH to an external provider bypass your resolver entirely. Control it: set browser policy to use the system resolver, block outbound DNS to anything except your resolvers, and consider an internal DoH endpoint. Endpoint-level query logging through Sysmon or EDR also survives, because it records the query before it leaves the host.
Look at shape rather than content. Tunnelling produces unusually long subdomain labels, high entropy in those labels, a high ratio of unique subdomains to a single parent domain, heavy use of TXT or NULL record types, and sustained query volume from one host to one domain. Baseline each metric per host, because a legitimate security product or anti-spam service can produce superficially similar patterns.
Keep full query detail hot for 30 to 90 days for investigation, and aggregated counts for 12 months so that historical hunting against newly published indicators is possible. Full retention for a year is affordable only for smaller estates. Decide the split deliberately, because the question investigators ask most often is whether a domain was ever resolved, and that is answerable from aggregates.
Do both. A protective resolver prevents many connections outright, which is more valuable than an alert nobody reads, but a block is also evidence that something on that host attempted the connection. Forward block events into your monitoring platform and treat repeated blocks from one host as an investigation trigger rather than as a problem already solved.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.