AWS Route 53: DNS Logging and Monitoring Study Guide
DNS logging and monitoring
DNS Logging and Monitoring: AWS Route 53
This guide covers the essential mechanisms for gaining visibility into DNS operations within AWS, specifically for the ANS-C01 Advanced Networking Specialty. It focuses on Route 53 integration with CloudWatch, CloudTrail, and Kinesis for security, troubleshooting, and compliance.
Learning Objectives
After studying this guide, you should be able to:
- Differentiate between DNS Query Logging, CloudTrail API Logging, and Resolver Logging.
- Identify the default monitoring intervals and data retention periods for Route 53 metrics in CloudWatch.
- Explain why the us-east-1 (N. Virginia) region is significant for global Route 53 metrics.
- Describe how to leverage Kinesis Data Firehose for real-time DNS log analysis.
- Configure monitoring for DNSSEC key health and failures.
Key Terms & Glossary
- Public Hosted Zone: A container for records that define how you want to route traffic on the internet.
- Recursive Lookup: The process where a DNS resolver queries multiple name servers to find the IP address for a domain.
- KSK (Key-Signing Key): An asymmetric customer-managed key stored in AWS KMS used to sign the ZSK.
- ZSK (Zone-Signing Key): An AWS-managed key used to sign the records within a hosted zone.
- Resolver DNS Firewall: A service that filters DNS queries for known malicious domains and generates metrics for CloudWatch.
The "Big Idea"
[!IMPORTANT] Visibility is the foundation of network security. In a cloud environment, DNS is often the first point of contact and the first indicator of compromise (e.g., DNS exfiltration or cache poisoning). Logging isn't just for troubleshooting; it's a critical security telemetry stream that enables AI/ML tools to detect patterns that humans might miss.
Formula / Concept Box
| Feature | Default Interval | Storage / Destination | Primary Purpose |
|---|---|---|---|
| CloudWatch Metrics | 1 Minute | CloudWatch (14-day retention) | Performance monitoring & Alarms |
| Resolver Metrics | 5 Minutes | CloudWatch | Hybrid/VPC traffic monitoring |
| Query Logs | Near Real-Time | CloudWatch Logs / S3 | Security auditing & Troubleshooting |
| CloudTrail Logs | Near Real-Time | S3 Bucket | Infrastructure change tracking (API) |
Hierarchical Outline
- CloudWatch Integration
- Hosted Zone Metrics: Total or sample query counts.
- Regional Repository: Metrics are aggregated in us-east-1 because Route 53 is a global service.
- DNSSEC Monitoring: Tracks failures (binary 1/0) and KSK age.
- Route 53 Logging Mechanisms
- DNS Query Logging: Captures the source IP, query type, and response code for hosted zone queries.
- Resolver Logging: Monitors queries originating from within a VPC (inbound/outbound).
- CloudTrail: Records "Who did what" (e.g.,
CreateHostedZone,ChangeResourceRecordSets).
- Advanced Analysis & Automation
- Kinesis Data Firehose: Streams logs to OpenSearch or S3 for long-term retention.
- Kinesis Analytics: Real-time filtering and aggregation of DNS events.
Visual Anchors
DNS Logging Architecture
KSK and ZSK Relationship
\begin{tikzpicture}[node distance=2cm, every node/.style={rectangle, draw, rounded corners, minimum width=3cm, minimum height=1cm, align=center}] \node (ksk) {Key-Signing Key (KSK) \\ \small{Managed in AWS KMS}}; \node (zsk) [below of=ksk] {Zone-Signing Key (ZSK) \\ \small{Managed by AWS}}; \node (records) [below of=zsk] {DNS Resource Records \\ \small{(A, AAAA, CNAME)}};
\draw[->, thick] (ksk) -- node[right] {\small{Signs}} (zsk);
\draw[->, thick] (zsk) -- node[right] {\small{Signs}} (records);
\draw[dashed] (-2.5, 0.5) rectangle (2.5, -4.5);
\node at (0, -5) {\textbf{DNSSEC Chain of Trust}};\end{tikzpicture}
Definition-Example Pairs
- Metric Filter: A tool to search and match patterns in log data to turn them into numerical CloudWatch metrics.
- Example: Creating a filter that counts how many times a "NXDOMAIN" (non-existent domain) response code appears in your Query Logs to detect potential scanning.
- VPC Flow Logs vs. DNS Logs: Flow logs show traffic at the IP layer; DNS logs show what names are being resolved.
- Example: A Flow Log shows a connection to
203.0.113.5, but a DNS Query Log shows that the user first resolvedmalicious-site.comto get that IP.
- Example: A Flow Log shows a connection to
Worked Examples
Problem: Identifying High Latency in DNS Resolution
Scenario: A company notices their application is slow to start. They suspect DNS resolution latency in their hybrid environment.
- Step 1: Enable Route 53 Resolver Logging for the VPCs in the hybrid network.
- Step 2: Configure logs to be sent to CloudWatch Logs.
- Step 3: Use CloudWatch Logs Insights to run a query:
fields @timestamp, query_name, query_type, answers.0.Rdata, query_duration| sort query_duration desc. - Result: The logs reveal that queries for on-premises domains being forwarded through an Outbound Endpoint are taking >500ms due to a bottleneck in the VPN tunnel.
Checkpoint Questions
- Which AWS region should you look in to find Route 53 Hosted Zone metrics in CloudWatch?
- What is the default retention period for Route 53 metrics in CloudWatch before they are deleted?
- How can you ensure that DNS Query Logs are saved for 7 years for regulatory compliance?
- What is the difference between KSK and ZSK in terms of management responsibility?
▶Click to see answers
- us-east-1 (N. Virginia).
- 14 days.
- Configure Kinesis Data Firehose to deliver the logs from CloudWatch to an Amazon S3 bucket with a lifecycle policy.
- KSK is customer-managed (in KMS); ZSK is managed transparently by AWS.
Muddy Points & Cross-Refs
- Global Service vs. Regional Logs: It is often confusing that Route 53 is "Global" but the logging and metrics must be managed in
us-east-1. Always check your provider's region setting when troubleshooting missing metrics. - Real-time vs. Near Real-time: CloudWatch metrics arrive in 1-minute intervals. If you need sub-second detection, you must use Kinesis streams directly.
- DNSSEC TTL: Route 53 DNSSEC has a hard-coded TTL of one week. This cannot be changed and is a frequent exam "distractor" point.
Comparison Tables
| Feature | DNS Query Logging | CloudTrail | VPC DNS Logging |
|---|---|---|---|
| Tracks... | Queries reaching Hosted Zones | API changes to R53 resources | Queries leaving/entering VPC |
| Source | External/Public/Private clients | Users/Roles (IAM) | EC2 Instances / Workloads |
| Security Value | Detects DDoS, Spoofing | Detects Unauthorized config | Detects Command & Control (C2) |
| Destination | CloudWatch Logs / S3 | S3 / CloudTrail Lake | CloudWatch Logs / S3 |