Skip to Content
Asterrr's Handbook
1 · Detection

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.

VPCDestination (same Region)DNS querylogloglogInstance queryRoute 53ResolverCloudWatch LogsS3 bucketData Firehose
A query logging configuration associated with a VPC delivers each unique query to one of three destinations.

What is logged

IncludedNotes
Queries from resources in associated VPCsAnd their responses
Queries from on-premises through an inbound Resolver endpoint
Queries using an outbound endpoint for recursion
Resolver DNS Firewall rule actionsAllow, 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

DestinationUse
CloudWatch LogsLogs Insights queries, metric filters and alarms, retention policy
S3Cheap long-term and audit storage. Query with Athena. Lifecycle rules
Data FirehoseStream 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

SourceScope
Resolver query logsDNS lookups from your VPCs through the AWS Resolver
Route 53 public hosted zone query loggingQueries about your public domains, a different thing
GuardDuty DNS data sourceInternal stream used for findings. Not visible to you
VPC Flow LogsTraffic 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

Scenario
GuardDuty is not enabled yet in a new account. The security team suspects that an EC2 instance in a private subnet is beaconing to a command-and-control domain through a NAT gateway, and wants to identify the domain names the instance has looked up from now on. The VPC uses the Amazon-provided DNS resolver. Which log source should the team enable?

GuardDuty, Security Lake, Log sources and the log archive account. Route 53 Resolver DNS Firewall blocks the domains these logs reveal.

Further reading

On this page