Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is DNS Log Analysis?

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.

Illustration for the cybersecurity term DNS Log Analysis
Home / Blog / Cybersecurity Terms / What Is DNS Log Analysis?
17 November 2026

What Is DNS Log Analysis?

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.

Getting the Data

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.

What to Look For

Handling the Volume

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 UK Protective DNS Angle

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.

FAQ – Frequently Asked Questions

Does DNS Over HTTPS Make DNS Logging Useless?

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.

How Do You Detect DNS Tunnelling?

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.

How Long Should DNS Logs Be Kept?

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.

Is Blocking at the Resolver Better Than Alerting?

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.

Related Terms

You May Be Interested In These

What Is Mobile Data Leakage?

Cybersecurity Terms

17 November 2026

What Is Mobile Data Leakage?

Read More
What Are Kernel Rootkit Techniques?

Cybersecurity Terms

17 November 2026

What Are Kernel Rootkit Techniques?

Read More