Route 53 Resolver query logs
DNS query logging for VPCs, what it captures, where it goes, and why it matters for threat hunting.
Exam tasks: 1.2 (skills 1.2.1 and 1.2.6: choosing log sources, network log sources)
The decision: which log shows the domain names a resource looked up, and how do you send it to one central place?
Resolver query logging records DNS queries answered by the Route 53 Resolver for your VPCs. It exposes DGA domains, DNS tunneling and command and control lookups. It is separate from GuardDuty's own DNS stream. GuardDuty needs no logging configured. You enable query logging for your own investigation and retention.
What is logged
| Included | Notes |
|---|---|
| Queries from resources in associated VPCs | And their responses |
| Queries from on-premises through an inbound Resolver endpoint | |
| Queries using an outbound endpoint for recursion | |
| Resolver DNS Firewall rule actions | Allow, alert or block recorded in the same log |
Each record carries Region, VPC ID, source IP and instance ID, timestamp, query name and type, response code, response data, transport, and DNS Firewall fields when a rule matched.
Exam trap
Only unique queries are logged. The Resolver caches answers for the TTL and a repeat query answered from cache is not logged. Queries sent straight to a third-party resolver never reach the Resolver, so they are not logged.
Destinations
| Destination | Use |
|---|---|
| CloudWatch Logs | Logs Insights queries, metric filters and alarms, retention policy |
| S3 | Cheap long-term and audit storage. Query with Athena. Lifecycle rules |
| Data Firehose | Stream to S3, OpenSearch Service or third-party SIEMs. Lambda can transform in flight |
S3 is a direct destination. It does not require Firehose.
- Destinations are CloudWatch Logs, S3 or Firehose. Share one query logging configuration with other accounts through AWS RAM so every VPC logs to the same central destination.
- Public DNS query logging for a public hosted zone is separate. It goes only to CloudWatch Logs in us-east-1 and records queries from the internet to your domain.
Resolver query logs versus others
| Source | Scope |
|---|---|
| Resolver query logs | DNS lookups from your VPCs through the AWS Resolver |
| Route 53 public hosted zone query logging | Queries about your public domains, a different thing |
| GuardDuty DNS data source | Internal stream used for findings. Not visible to you |
| VPC Flow Logs | Traffic metadata, no domain names |
Security Lake can ingest Resolver query logs natively.
Exam signal
"Investigate which instance looked up a suspicious domain" or "detect DNS exfiltration": enable Resolver query logging and analyze with Logs Insights or Athena. "Alarm on lookups to a blocked domain": DNS Firewall plus metric filter.
Scenarios
Resolver query logs record every name the instance resolves through the VPC resolver, which is what reveals a C2 domain. Flow logs show IP addresses but never domain names. Public DNS query logging records queries from the internet about the company's own domain, not outbound lookups. CloudTrail has no data events for DNS lookups.
Related
GuardDuty, Security Lake, Log sources and the log archive account. Route 53 Resolver DNS Firewall blocks the domains these logs reveal.
Further reading
Log sources and the log archive account
Choosing log sources for a security question, CloudTrail trails and organization trails, data and network activity events, VPC and transit gateway flow logs, service access logs, and a protected log archive account.
Amazon Security Lake
Managed security data lake in S3 using OCSF and Parquet. The answer for central, queryable security logs from many accounts and sources.