Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› DNS Query Logs
Cyber Security

DNS Query Logs

← Back to Glossary
By NHI Mgmt Group Updated November 3, 2026 Domain: Cyber Security

DNS query logs are records of DNS lookup activity, showing which names were queried, when, from where, and what responses were returned. They are used to analyse name resolution, investigate suspicious domains, and spot patterns such as beaconing, data exfiltration, or misdirected traffic.

What DNS query logs show and why they matter

DNS query logs are more than a record of lookups. They capture the timing, origin, queried name, and response path for name resolution, which makes them useful for seeing how hosts, applications, and resolvers actually reach services on the internet and inside the network.

That visibility matters because DNS is one of the most common control planes in day-to-day traffic. A clean-looking query stream can still hide suspicious activity, while malformed or unexpected lookups can reveal malware activity, misconfiguration, or a host trying to reach infrastructure it should not be using.

What analysts look for in DNS query logs

The first value of DNS query logs is correlation. They let analysts tie a device, user, or resolver to a specific domain request and then compare that request with other telemetry such as endpoint events, firewall logs, proxy records, or server-side alerts. That makes the logs especially useful when the question is not just “what was queried?” but “what was the host trying to do?”

Analysts commonly use them to spot patterns that stand out from normal browsing or service traffic, including repeated failed lookups, bursts of unique subdomains, connections to unusual geographies or newly registered domains, and lookups that precede later connections to the same destination. Those patterns can indicate beaconing, tunnelling, or a system resolving names that belong to a hidden dependency or misrouted service.

DNS query logs also help when organisations need to reconstruct the path of an incident. If a host contacted a suspicious domain, the logs can show whether the request came from a user workstation, a server, a container host, or a resolver tier, and whether the response was a normal address, an NXDOMAIN, or something that suggests filtering, poisoning, or interference.

Collection quality, visibility gaps, and interpretation limits

DNS logs are only as useful as the collection point and field coverage. Resolver logs, endpoint DNS telemetry, and network sensor logs each show different parts of the same event, so analysts often need more than one source to separate end-user browsing from internal service discovery or security tooling. That is especially important in environments with split-horizon DNS, forwarding chains, or multiple recursive resolvers.

Encrypted DNS can reduce or fragment visibility if organisations do not log at the right layer. If DNS over HTTPS or DNS over TLS is used outside approved resolvers, the resolver may never see the full picture, and query logs may not explain where a host actually went. That does not make DNS logging useless, but it does mean the logs must be interpreted alongside egress controls and endpoint telemetry.

DNS query logs can also create false confidence. A query alone does not prove compromise, and normal-looking queries can still be part of malicious activity if the attacker is blending into expected traffic. The value comes from comparing query behaviour with baseline patterns, asset context, and the organisation’s known approved resolvers and domains.

Using DNS query logs in incident response and threat hunting

In incident response, DNS query logs help establish first seen activity, scope lateral movement, and determine whether a host reached out to a suspicious domain before other signs of compromise appeared. They are also useful for finding additional affected systems when the same domain, subdomain pattern, or resolver behaviour repeats across endpoints.

For threat hunting, DNS logs are strongest when they are treated as a behavioural source rather than a standalone alert feed. A hunt can start from a suspicious domain, a spike in query volume, or a strange response pattern and then expand into endpoint, proxy, and network records to determine whether the activity reflects benign failure, application dependency, or malicious command-and-control.

When DNS query logs are retained with enough context, they become a historical record of resolution behaviour that supports both detection and post-incident review. That makes them one of the most practical telemetry sources for understanding how traffic is shaped before a connection is ever established.

Risk and Threat Considerations

DNS query logs expose a high-value view of how systems discover and reach services, which is why attackers often try to hide inside DNS behaviour rather than bypass it. Poor collection, short retention, or logging only one resolver layer can leave organisations blind to beaconing, tunnelling, and domain lookups that precede later compromise.

Failure mechanism: If DNS telemetry is incomplete, encrypted at the wrong layer, or not correlated with endpoint and resolver context, malicious lookups can look like routine name resolution and evade investigation.

Impact: Missing or partial DNS visibility can delay incident scoping, reduce confidence in containment decisions, and allow compromised hosts to continue reaching attacker-controlled infrastructure.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP API Security Top 10 and MITRE ATT&CK address the attack and risk surface, while CIS Controls v8, NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
CIS Controls v8CIS-8 — Audit Log ManagementDNS query logs are audit records that support collection, retention, and review controls.
Recommendation — Centralize DNS audit logs, retain them long enough for investigations, and review them for suspicious lookup patterns.
NIST SP 800-53 Rev 5AU-6 — Audit Review, Analysis, and ReportingDNS query logs need review and correlation to detect suspicious name-resolution behaviour.
Recommendation — Analyze DNS logs for anomalies, correlate them with other telemetry, and escalate suspicious resolution activity.
OWASP API Security Top 10API9 — Improper Inventory ManagementDNS logs help identify unknown or unmanaged services by showing observed name-resolution activity.
Recommendation — Compare observed DNS lookups against your service inventory to find shadow services and unexpected exposure.
MITRE ATT&CKT1071.004 — Application Layer Protocol: DNSDNS query logs are a primary source for detecting command-and-control and other DNS-based abuse.
Recommendation — Map suspicious DNS patterns to T1071.004 and hunt for beaconing, tunnelling, and DNS-based C2.
NIST CSF 2.0DE.CM-01 — Network MonitoringDNS query logs are network-monitoring telemetry used to detect anomalous communication patterns.
Recommendation — Monitor DNS traffic continuously and investigate deviations from normal resolution behaviour.

Practitioner Guidance

Why practitioners should care: DNS query logs are most valuable when they answer a specific operational question, such as which resolver saw the request, which client originated it, and whether the result matched expected behaviour. If those fields are not being kept consistently, the log source may exist but the investigation value is much lower.

What to watch for: Preserve the fields that let you reconstruct resolution behaviour, then validate them against your approved DNS architecture and detection use cases. For a deeper implementation view on collection points, fields, and detection logic, use the DNS Logging and Detection Guide.

Practitioner takeaway: Treat DNS query logs as both a detection source and an investigation record, then make sure they are collected at the layer where your environment actually resolves names.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 3, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org