Sysmon event 22
DNSEvent (DNS query)
Channel: Microsoft-Windows-Sysmon/Operational. Category: DNS Query.
What it records
Logs DNS queries made by a process, whether the result succeeded, failed, was cached, or not. Telemetry for this event was added for Windows 8.1 and is not available on Windows 7 and earlier.
Why it matters
Per-process DNS query logging helps identify malware beaconing to C2 domains, DNS tunneling, or domain-generation-algorithm activity by tying specific lookups back to the requesting process.
What triggers it
Every application performing name resolution triggers it at high volume. Normal browsing/service traffic as well as malware resolving C2 domains or performing DNS-based exfiltration/tunneling.
Fields that carry the answer
| Field | What it tells you |
|---|---|
| QueryName | The domain name being resolved: the primary IOC; check for DGA-style randomness, newly-registered domains, or known C2 infrastructure. |
| Image | The process that performed the lookup, which ties a suspicious domain to the specific executable responsible, especially valuable when it isn't a browser. |
| QueryStatus | The result status code of the query, which distinguishes a successful resolution from a failed/NXDOMAIN lookup, useful for spotting DGA malware churning through unregistered domains. |
| QueryResults | The IP address(es) returned, which gives you resolved infrastructure to pivot on even when only the domain was captured elsewhere. |
In practice
Image C:\Users\jsmith\AppData\Roaming\update.exe queries QueryName svc-update.example with QueryStatus 0 and QueryResults 203.0.113.77: a non-browser process resolving a domain outside any known update channel is a solid beaconing indicator worth pivoting into Event 3's network-connection data for the same process.
Sample record
Dns query:
RuleName: -
UtcTime: 2024-02-11 09:43:12.204
ProcessGuid: {a1b2c3d4-1234-65a1-0000-001122334466}
ProcessId: 7148
QueryName: update.example.com
QueryStatus: 0
QueryResults: ::ffff:198.51.100.42;
Image: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exeATT&CK techniques
- T1071.004: DNS
Sources
Paste a record into Event XML or open a log in EVTX Reader.