networkingdnscost-optimizationaws

DNS query cost at scale: when a tenth of a cent starts to matter

DNS is priced per million queries, which feels free until you count how many queries a busy system actually makes. TTLs, health checks, and service discovery all move the number. Here is the math.

The C3X Team··7 min read

Quick answer

Route 53 charges 0.40 dollars per million standard queries for the first billion per month and 0.20 dollars per million beyond that, plus 0.50 dollars per hosted zone per month. Latency, geolocation, and geoproximity records cost 0.60 dollars per million for the first billion. A service handling 5 billion queries per month with standard records pays about 1,000 dollars. The number is driven almost entirely by TTL: raising a record's TTL from 60 seconds to 300 seconds cuts resolver-driven query volume roughly fivefold, though it slows failover.

DNS rarely appears on a cost review agenda. Its unit price looks like a rounding error: a hosted zone is 50 cents a month and queries are priced per million. But query volume in a modern system is not small, and a handful of design choices, short TTLs, alias chains, health-checked failover records, and service-discovery loops, can multiply it by an order of magnitude without anyone noticing.

The published rates

ItemRoute 53Cloud DNS (GCP)Azure DNS
Hosted zone / month0.50 (first 25)0.20 per zone0.50 (first 25)
Queries, first 1B/month0.40 per million0.40 per million0.40 per million
Queries beyond 1B0.20 per million0.20 per million0.20 per million
Latency/geo routing0.60 per millionIncludedn/a
Health check (basic)0.50 per monthvariesvaries

Alias records pointing at AWS resources such as an ELB, CloudFront distribution, or S3 website endpoint are not charged for queries at all on Route 53. That exemption is worth real money and is the single most underused DNS cost lever in the AWS ecosystem.

What drives query volume

Recursive resolvers cache answers for the duration of the TTL, so authoritative query volume is roughly the number of distinct resolvers multiplied by the number of TTL windows per month, plus a long tail from resolvers that do not honor caching well. Concretely: a record with a 60 second TTL can be queried up to 43,200 times per month per resolver. Raise it to 300 seconds and that ceiling drops to 8,640.

With 50,000 distinct resolvers touching a record, 60 second TTL implies an upper bound around 2.16 billion queries per month. Real volume is lower because not every resolver queries in every window, but the shape holds: query cost scales inversely with TTL. Going from 60 to 300 seconds on a hot record can take a 600 dollar monthly line to about 140 dollars.

The failover trade-off

Short TTLs exist for a reason. They shorten the window during which clients keep resolving to a failed endpoint. But DNS failover is a blunt instrument even at 60 seconds, because many clients and intermediate resolvers ignore TTLs and cache longer, and because Java applications historically cached DNS for the process lifetime. If you need fast failover, a load balancer health check that removes a target in seconds is far more reliable than a DNS TTL, and it costs nothing per query. Use DNS for coarse regional failover with a 60 second TTL on a small number of records, and longer TTLs everywhere else.

Service discovery loops

The expensive pattern in containerized environments is internal service discovery over DNS. If 500 pods each resolve 20 service names every 5 seconds because the resolver cache is disabled or the TTL is zero, that is 500 times 20 times 12 per minute, or 120,000 queries per minute, which is about 5.2 billion per month. On a private hosted zone at 0.40 dollars per million for the first billion and 0.20 after, that is around 1,240 dollars monthly for internal name lookups.

In Kubernetes the standard fixes are a node-local DNS cache, raising ndots handling so that searches do not generate four failed lookups before the successful one, and setting sensible TTLs on internal records. The ndots issue alone commonly inflates query counts by a factor of four or five, because a lookup for a short name tries each search domain in turn.

Health checks and resolver endpoints

Route 53 health checks are 0.50 dollars per month for endpoints inside AWS and 0.75 dollars for external endpoints, plus optional features such as HTTPS string matching at 1.00 dollar each. A few dozen health checks is a few tens of dollars, negligible. Resolver endpoints for hybrid DNS are not negligible: each elastic network interface for an inbound or outbound resolver endpoint is 0.125 dollars per hour, so a highly available pair costs about 180 dollars per month before queries, which are charged at 0.40 dollars per million. Comparisons across providers appear in DNS cost comparison.

Practical checklist

Use alias records for AWS targets to get free queries. Raise TTLs on anything that does not need second-level failover, 300 to 3,600 seconds is usually fine for static records. Deploy a node-local DNS cache in Kubernetes and fix ndots. Reserve latency and geolocation routing, at 0.60 dollars per million, for records that genuinely need it rather than applying it estate-wide. Consolidate zones where you have dozens of nearly-empty ones. And put query volume on a dashboard so a runaway resolver loop shows up in hours rather than on the invoice. Price your DNS and networking against the resource catalog.

FAQ

How much does Route 53 charge per DNS query?

0.40 dollars per million standard queries for the first billion per month and 0.20 dollars per million beyond that, plus 0.50 dollars per hosted zone per month for the first 25 zones. Latency, geolocation, and geoproximity records cost 0.60 dollars per million for the first billion. Alias records pointing at AWS resources such as ELBs and CloudFront distributions are not charged per query at all.

How does TTL affect DNS cost?

Directly and inversely. Recursive resolvers cache answers for the TTL duration, so a 60 second TTL allows up to 43,200 queries per month per resolver while a 300 second TTL allows 8,640. Raising a hot record's TTL from 60 to 300 seconds can take a 600 dollar monthly line down to around 140 dollars, at the cost of slower DNS-based failover.

Why is internal service discovery expensive?

Because it multiplies. If 500 pods each resolve 20 service names every 5 seconds with no resolver cache, that is 120,000 queries per minute, around 5.2 billion per month, costing roughly 1,240 dollars on a private hosted zone. Kubernetes ndots handling makes it worse by trying each search domain in turn, commonly inflating counts fourfold or fivefold before the successful lookup.

Is DNS a reliable way to fail over?

Less than people assume. Many clients and intermediate resolvers ignore TTLs and cache longer, and some runtimes historically cached DNS for the process lifetime. A load balancer health check that removes an unhealthy target in seconds is far more reliable and carries no per-query charge. Use DNS for coarse regional failover on a small number of short-TTL records and longer TTLs elsewhere.

What do Route 53 resolver endpoints cost?

Each elastic network interface for an inbound or outbound resolver endpoint costs 0.125 dollars per hour, so a highly available pair runs about 180 dollars per month before queries, which are billed at 0.40 dollars per million. Health checks are comparatively trivial at 0.50 dollars per month for AWS endpoints and 0.75 for external ones.

How does C3X help with DNS cost?

C3X prices infrastructure from Terraform before deployment, including hosted zones, record sets, health checks, and resolver endpoints. Resolver endpoint pairs and large numbers of zones are easy to add without noticing their standing cost, so seeing them priced in the pull request is where those choices get examined before they become a recurring line.

What to do next

Price your DNS footprint before you apply. C3X costs Terraform against a live resource catalog. Start with the quickstart.

Try C3X on your own Terraform

Free and open source. No API key required. One command to install, one command to estimate.