Lesson 4 of 4 Amazon Route 53

Logging DNS Queries and Extending Resolution with Route 53 Resolver

This lesson explains how the Route 53 Resolver provides DNS for VPCs, how it extends to on-premises networks, and how both public and Resolver queries are logged.

Learning outcomes

After completing this lesson, you will be able to:

  • Configure Resolver endpoints and rules.
  • Enable public DNS query logging.
  • Enable Resolver query logging.
  • Resolve on-premises names from a VPC.

The Resolver and its endpoints

Every VPC has a Route 53 Resolver at the VPC CIDR base address plus two (for example 10.0.0.2) and at 169.254.169.253. It answers queries for private hosted zones, VPC-internal names and public names. Hybrid networks need DNS in both directions. An inbound endpoint creates ENIs with IP addresses in your VPC that on-premises DNS servers forward queries to, so on-premises clients can resolve private hosted zone names and interface endpoint names. An outbound endpoint creates ENIs from which the Resolver forwards queries; forwarding rules specify which domains (for example corp.example.internal) go to which target IP addresses on premises. Rules are associated with VPCs and can be shared with other accounts through AWS RAM. Endpoints need security groups allowing DNS (UDP and TCP 53) and should span at least two AZs.

The following diagram shows queries crossing in each direction.

DNS in both directions. On-premises DNS servers forward queries for private hosted zones and interface endpoint names to an inbound endpoint's ENIs. The Resolver, at the VPC base address plus two, forwards queries for domains such as corp.example.internal to on-premises servers through an outbound endpoint and its forwarding rules.
The CIDR and domain are illustrative.
Sort into groups

Inbound or outbound endpoint?

Exam skills 5.2.1

Decide which Resolver endpoint each hybrid DNS requirement needs.

Log in to try this activity Interactive activities are free with an account.

Public DNS query logging

Public DNS query logging records queries that reach Route 53's authoritative servers for a public hosted zone: the domain, record type, response code, edge location and resolver IP. Logs go to a CloudWatch Logs log group that must be in us-east-1, with a resource policy allowing Route 53 to write. Because resolvers cache answers, only queries that are not answered from caches are logged.

Resolver query logging

Resolver query logging records DNS queries made by resources inside VPCs, including queries forwarded through outbound endpoints and queries blocked by DNS Firewall, with the source instance, query name, type, response code and answers. Logs go to CloudWatch Logs, S3 or Firehose, and a configuration can be shared across accounts with AWS RAM. It is used to troubleshoot resolution failures (NXDOMAIN, SERVFAIL), find which workloads query a domain and investigate suspicious lookups. The following table compares the two kinds of logging.

Public DNS query logging
What is loggedInternet queries to your public hosted zone
DestinationsCloudWatch Logs in us-east-1
Includes source instanceNo (resolver IP only)
Typical useAnalyse public traffic to your domains
Resolver query logging
What is loggedQueries made by resources in your VPCs
DestinationsCloudWatch Logs, S3, Firehose
Includes source instanceYes
Typical useTroubleshoot VPC DNS, security investigations
Scenario questions

Which query log?

Exam skills 5.2.2 · 5.3.2

Choose the right kind of DNS query logging.

Log in to try this activity Interactive activities are free with an account.
Worked example

Resolving on-premises names

Applications in a VPC connected to the data centre over Site-to-Site VPN cannot resolve db1.corp.example.internal. Resolver query logs show NXDOMAIN responses. The team creates an outbound endpoint in two private subnets, a forwarding rule for corp.example.internal targeting the two on-premises DNS servers, and associates the rule with the VPC. On-premises users also need to resolve orders.internal.aws, a private hosted zone, so the team creates an inbound endpoint and configures a conditional forwarder on the on-premises DNS servers that points to its two IP addresses. Security groups on both endpoints allow DNS from the relevant networks.

Check yourself

Where must public DNS query logs be sent?

Show answer

To a CloudWatch Logs log group in us-east-1.

Exam Tips

Remember for the exam

  • Inbound endpoint: on premises resolves AWS names. Outbound endpoint plus rules: AWS resolves on-premises names.
  • Share forwarding rules across accounts with AWS RAM.
  • Public query logs must go to CloudWatch Logs in us-east-1.
  • Resolver query logs record VPC queries with the source instance to CloudWatch Logs, S3 or Firehose.