A download cradle resolving a payload host.
What gives it awayA shell or scripting engine querying an external name, usually immediately before a network connection.
ATT&CK T1105Nothing matches that yet. Tell us what you were looking for and it goes on the list.
Sysmon · Event 22
A process looked up a hostname, and Sysmon recorded which process asked. That attribution is what DNS server logs cannot give you, and it turns a list of queried domains into a list of programs querying them.
Also written as Sysmon 22Sysmon Event ID 22DNSEventSysmon DNS query
Only present if you installed Sysmon. It records which programs look up website addresses.
Available from Sysmon 10 onward. Its advantage over DNS server logs is process attribution; its cost is volume. Exclude your own domains, telemetry endpoints, and content delivery networks in the configuration. Note that applications using DNS-over-HTTPS bypass this entirely, which is a growing blind spot worth knowing about.
Sanitised. Addresses come from the RFC 5737 documentation ranges.
Dns query:
RuleName: -
UtcTime: 2026-08-28 09:14:06.118
ProcessGuid: {a1b2c3d4-0000-0000-0000-00000000abcd}
ProcessId: 7412
QueryName: cdn-update.example.invalid
QueryStatus: 0
QueryResults: type: 5 cdn-update-edge.example.invalid;::ffff:198.51.100.203;
Image: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
User: CORP\jbrooks Everything else in the log line is context.
powershell.exe or cmd.exeA shell resolving a hostname, usually just before downloading something. rundll32.exe, regsvr32.exe, or mshta.exeSystem binaries with no ordinary reason to resolve external names. A browserOrdinary traffic and the bulk of the volume. A very long random-looking subdomainCharacteristic of DNS tunnelling and of algorithmically generated domains. A dynamic DNS provider domainCommon in low-effort command and control infrastructure. A recently registered domainNot visible in the event itself, but worth enriching against — newly registered domains are disproportionately malicious. Most of the time it is one of these.
What gives it awayA shell or scripting engine querying an external name, usually immediately before a network connection.
ATT&CK T1105What gives it awayMany failed lookups for random-looking names from one process, as the malware works through a list looking for the live one.
ATT&CK T1568.002What gives it awayLong, high-entropy subdomains under a single parent domain, queried repeatedly by one process.
ATT&CK T1071.004What gives it awayQueries to dynamic DNS providers from processes that are not browsers.
ATT&CK T1071.001Event | where Source == 'Microsoft-Windows-Sysmon' and EventID == 22 | extend Proc = tostring(split(Image, '\\')[-1]) | where Proc in~ ('powershell.exe','cmd.exe','wscript.exe','cscript.exe','mshta.exe','rundll32.exe','regsvr32.exe','certutil.exe') | project TimeGenerated, Computer, Proc, QueryName Event | where Source == 'Microsoft-Windows-Sysmon' and EventID == 22 | extend Label = tostring(split(QueryName, '.')[0]) | where strlen(Label) > 30 | summarize count() by Image, tostring(split(QueryName, '.')[-2]), Computer | where count_ > 20 Event | where Source == 'Microsoft-Windows-Sysmon' and EventID == 22 and QueryStatus == '9003' | summarize failures = dcount(QueryName) by Image, Computer, bin(TimeGenerated, 10m) | where failures > 30 index=sysmon EventCode=22 | stats dc(QueryName) as domains by Image host | sort -domains Event 22 arrived in Sysmon 10. Earlier versions cannot record DNS queries at all, so if you are not seeing them, check your version before troubleshooting the configuration.
Because it names the process that made the query. A DNS server log tells you a machine looked up a domain; Sysmon tells you which program did, which is usually the difference between an unactionable alert and a clear one. The trade-off is volume and the need to deploy Sysmon everywhere.
No. Applications that resolve names through encrypted DNS bypass the Windows resolver entirely, so no event is generated. Browsers increasingly do this by default, which is a real and growing blind spot — the usual mitigation is policy that forces browsers to use the system resolver.
Look at the shape of the query names rather than their reputation. Tunnelling produces long, random-looking subdomain labels under one parent domain, queried repeatedly by a single process. Grouping by parent domain and process, and filtering for unusually long labels and high query counts, surfaces it reliably.
Last reviewed 28 August 2026