Study Guide845 words

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

FeatureDefault IntervalStorage / DestinationPrimary Purpose
CloudWatch Metrics1 MinuteCloudWatch (14-day retention)Performance monitoring & Alarms
Resolver Metrics5 MinutesCloudWatchHybrid/VPC traffic monitoring
Query LogsNear Real-TimeCloudWatch Logs / S3Security auditing & Troubleshooting
CloudTrail LogsNear Real-TimeS3 BucketInfrastructure change tracking (API)

Hierarchical Outline

  1. 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.
  2. 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).
  3. 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

Loading Diagram...

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)}};

code
\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 resolved malicious-site.com to get that IP.

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.

  1. Step 1: Enable Route 53 Resolver Logging for the VPCs in the hybrid network.
  2. Step 2: Configure logs to be sent to CloudWatch Logs.
  3. 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.
  4. 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

  1. Which AWS region should you look in to find Route 53 Hosted Zone metrics in CloudWatch?
  2. What is the default retention period for Route 53 metrics in CloudWatch before they are deleted?
  3. How can you ensure that DNS Query Logs are saved for 7 years for regulatory compliance?
  4. What is the difference between KSK and ZSK in terms of management responsibility?
Click to see answers
  1. us-east-1 (N. Virginia).
  2. 14 days.
  3. Configure Kinesis Data Firehose to deliver the logs from CloudWatch to an Amazon S3 bucket with a lifecycle policy.
  4. 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

FeatureDNS Query LoggingCloudTrailVPC DNS Logging
Tracks...Queries reaching Hosted ZonesAPI changes to R53 resourcesQueries leaving/entering VPC
SourceExternal/Public/Private clientsUsers/Roles (IAM)EC2 Instances / Workloads
Security ValueDetects DDoS, SpoofingDetects Unauthorized configDetects Command & Control (C2)
DestinationCloudWatch Logs / S3S3 / CloudTrail LakeCloudWatch Logs / S3

Ready to study AWS Certified Advanced Networking - Specialty (ANS-C01)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free