Windows API reference
DnsQuery_W
Resolves a name to records using the Windows DNS client, optionally bypassing the local cache.
- Library
- Dnsapi.dll
- Category
- Network / Sockets
- Suspicion
- high
- MITRE ATT&CK
- T1071.004 Application Layer Protocol: DNS
Detection summary
DnsQuery_W maps to Sysmon Event 22 and Microsoft-Windows-DNS-Client; these events record the OS effect, not the API call.
- Sysmon: Sysmon Event 22
- ETW: Microsoft-Windows-DNS-Client
- Notes: Sysmon Event 22 records the DNS query and returned addresses; cached or hosts-file resolution may not generate it. Microsoft-Windows-DNS-Client records the query; Sysmon Event 22 is the usual consumer.
Sources and documentation
- Microsoft Learn documentation (direct documentation)
Not yet human-reviewed. Page metadata generated .
Legitimate use
Browsers, games, IM clients, IT tooling and updaters.
Related APIs
- DnsQueryEx — Dnsapi.dll
- DnsRecordListFree — Dnsapi.dll
- getaddrinfo — Ws2_32.dll