[DNS Fundamentals Part 10] DNS in the Cloud and on Corporate Networks: Route 53, Hybrid Name Resolution, AD-Integrated DNS, Kubernetes

DNS Fundamentals Part 10 DNS in the Cloud and on Corporate Networks: Route 53, Hybrid Name Resolution, AD-Integrated DNS, Kubernetes DNS

“I can’t resolve on-premises server names from EC2.”
“After moving to Kubernetes, calls to an external API got slow.”

In cloud and container environments, the parts of DNS are built into places you can’t easily see. Without knowing how they work, you can’t even tell where a name is being resolved, and isolating a problem takes a long time.

But don’t worry. Even if the names of the parts change, what’s inside is the same “caching DNS, authoritative DNS, and conditional forwarding” we saw up through Part 3. In Part 10 we look at AWS DNS centered on Route 53, hybrid name resolution with on-premises networks, how it maps to Azure, and then DNS for AD-integrated DNS, Kubernetes, and vSphere.

▶ This part is also available as a YouTube video (about 19 min) (it is also embedded at the end of this article).


Route 53 overview and hosted zones

Route 53 is AWS’s DNS service, and it has three roles.

Diagram showing that Route 53 has functions with different roles: public hosted zones published to the internet, private hosted zones associated with VPCs, domain registration (registrar), and VPC Resolver
  1. Hosted zones: authoritative DNS servers
  2. Domain registration: a registrar
  3. VPC Resolver: a full-service resolver used inside a VPC

There are two kinds of hosted zones.

  • Public hosted zone: A zone published to the internet. Creating one assigns four name servers (awsdns domains in com, net, org, and co.uk). Delegation is not complete until you register these four as NS at your registrar (Part 2)
  • Private hosted zone: A zone that can be queried only from within the VPCs you associate with it

If you create a public and a private zone with the same name, you get split horizon, with different answers inside and outside the VPC (Part 7). If you think of this as one service containing three DNS functions with different roles, it won’t be confusing.


Alias records, routing policies, and health checks

FeatureHow it behaves as DNSNotes
Alias recordRoute 53 resolves the target internally and answers as A/AAAACan also be used at the zone apex. A Route 53-specific feature that cannot be reproduced with zone transfers or another provider’s DNS
TTL of an aliasThe target’s TTL is used (fixed at 60 seconds when pointing to an ELB)You cannot set the TTL yourself. Queries to aliases for AWS resources are not charged
WeightedChanges the answer according to the weight ratioAnswers are cached, so the actual ratio is only approximate
Latency, geolocation, and IP-basedChanges the answer by where the query comes from (the caching DNS’s IP, or the client’s subnet if ECS is supported)Through an internal forwarder, the decision is based on the location of that egress point
Failover + health checkReturns the primary answer when healthy and the standby answer when notSwitches only after the TTL expires. In private hosted zones the checkers are outside the VPC, so use a type based on a CloudWatch alarm
Multivalue answerReturns up to 8 healthy records at randomNot a substitute for a load balancer
Diagram showing that with an alias record, Route 53 answers a caching DNS's A query with the address of the ALB, and that with failover, a health check detects a failure in the primary (Tokyo) and the answer changes to the standby (Osaka), but the caching DNS keeps using the old answer until the TTL expires

The point to take away is that all of these change the answer that the authoritative DNS returns. They have no effect until the TTL expires for caching DNS servers and devices that already hold an answer (Part 3). Route 53 changes the answer; the caching DNS remembers the old one.

Also note that latency and geolocation routing decide based on “where the query comes from,” so through an internal forwarder, the decision is based on the location of that egress point. Even an employee in Osaka is judged to be in “Tokyo” if the query comes from a DMZ in Tokyo.


VPC DNS (Route 53 VPC Resolver)

EC2 instances in a VPC use AWS’s full-service resolver, the Route 53 VPC Resolver (renamed from Route 53 Resolver in 2025), through the AmazonProvidedDNS in the DHCP option set. The destination is the first address of the CIDR plus 2 (10.0.0.2 for 10.0.0.0/16) or 169.254.169.253.

Diagram showing an EC2 instance in a VPC (10.0.0.0/16) querying the VPC Resolver, which forwards from an outbound endpoint if a forwarding rule matches, answers from the zone if a private hosted zone matches, and queries the internet recursively if neither matches, with the most specific match being used
  • You cannot use private hosted zones unless both VPC attributes, enableDnsSupport and enableDnsHostnames, are enabled
  • The forwarding rule or private hosted zone that matches the name most specifically is used, and for the same name, the forwarding rule takes priority
  • A name that is not in the matching zone gets NXDOMAIN without asking the internet
  • There is a limit of 1,024 packets per second per ENI

The third point is an easy one to get caught on. For example, if you create a private hosted zone for example.com, www.example.com, which you did not register there, returns NXDOMAIN even if it is published on the internet.


Resolver endpoints and forwarding rules

These are the parts that let on-premises networks and VPCs resolve each other’s names.

PartDirectionRoleDesign notes
Inbound endpointOn-premises → VPCThe destination to which the on-premises DNS forwards using conditional forwarders. Returns the same answers as VPC Resolver (including private hosted zones)Place IPs in two or more AZs. Allow TCP/UDP 53 in the security group
Outbound endpointVPC → on-premisesSends queries that match a forwarding rule out to the on-premises DNSOn the on-premises side, allow queries from the source (the endpoint’s IPs)
Forwarding rule (FORWARD)VPC → on-premisesForwards names such as corp.example.com to the specified DNS. Takes effect when associated with a VPCRegister two or more on-premises DNS servers as targets
System rule (SYSTEM)n/aAn exception to forwarding rules that makes VPC Resolver resolve specific namesExample: forward . entirely to on-premises, but make amazonaws.com an exception
Delegation rule (DELEGATE)Both directionsConnects to on-premises through NS record delegation instead of a conditional forwarder (since 2025)For DNS products where conditional forwarders are hard to configure
Sharingn/aShare rules with other accounts through AWS RAM. Route 53 Profiles distribute zones, rules, and DNS Firewall togetherEndpoints can be consolidated in a central account
Diagram showing an on-premises internal DNS connected by VPN or Direct Connect to a VPC in a central account, with inbound and outbound endpoints in each AZ, and forwarding rules and system rules shared with other accounts through AWS RAM

A single endpoint IP can handle roughly 10,000 UDP queries per second (less with large responses or slow forwarding targets). Pricing depends on the number of IPs and the number of queries.

These look like new parts, but the idea behind forwarding rules is exactly the conditional forwarding of Part 3.


Query logs, DNS Firewall, and Global Resolver

Diagram showing DNS Firewall deciding ALLOW, ALERT, or BLOCK for queries from EC2 in a VPC and query logs going to CloudWatch Logs, S3, and Firehose, plus the Global Resolver that on-premises and remote devices can use over anycast
  • Query logs: Record queries from the VPC to VPC Resolver, queries that pass through endpoints, and DNS Firewall decisions. They can be sent to CloudWatch Logs, S3, and Firehose. Knowing “which instance looked up what, and when” is a clue for both outage and security investigations. However, queries answered from device or OS caches, and queries dropped at the 1,024 pps limit, do not appear in the logs
  • DNS Firewall: Allows (ALLOW), blocks (BLOCK), or alerts on (ALERT) queries leaving the VPC using domain lists. When blocking, you choose whether to answer with NODATA, NXDOMAIN, or OVERRIDE (replacement with a CNAME). There are AWS-managed domain lists (malware, etc.) and DNS Firewall Advanced (detects DNS tunneling and DGA). This is the cloud version of the protective DNS and RPZ in Part 9
  • Route 53 Global Resolver (generally available in March 2026): A resolver that lets on-premises and remote devices resolve private hosted zone names and internet names over anycast. Filtering and logs can also be consolidated in one place

DNS Firewall decides by name only. It cannot stop traffic that specifies an IP address directly or goes out through DoH. Start with ALERT to check the impact, then switch to BLOCK.


Hybrid name resolution with on-premises networks

So how should you design for the opening problem, “I can’t resolve on-premises names from EC2”? Between on-premises and AWS, the two sides resolve each other’s names with conditional forwarders in both directions.

Diagram showing that when an on-premises device looks up app.aws.corp.example.com, the internal DNS forwards to the inbound endpoint and the answer comes from the private hosted zone, and that when EC2 looks up dc01.corp.example.com, the forwarding rule sends it through the outbound endpoint to the on-premises DNS
  • On-premises → AWS: When an on-premises device looks up app.aws.corp.example.com, the internal DNS forwards over VPN or Direct Connect to the inbound endpoint, and the answer from the private hosted zone comes back
  • AWS → on-premises: When EC2 looks up dc01.corp.example.com, the forwarding rule sends it from the outbound endpoint to the on-premises DNS

On the way there, ② is the inbound endpoint; on the way back, ⑥ is the outbound endpoint. There are three key points in the design:

  1. Put the AWS side in a subdomain such as aws.corp.example.com to keep the forwarding conditions simple
  2. Do not create a loop in which forwarding bounces between the same VPC and on-premises
  3. Use two or more of everything: AZs, DNS servers, and lines

How Azure compares

In Azure, too, the roles of the parts map one to one, even though the names differ.

RoleAWSAzureDifferences and notes
Public zones (authoritative DNS)Route 53 public hosted zonesAzure DNS (public DNS)Both have aliases that point to your own resources at the zone apex
Internal zonesPrivate hosted zones (associated with VPCs)Private DNS zones (virtual network links)Azure can automatically register VM names
Resolver inside the VPC/VNetVPC Resolver (CIDR + 2, 169.254.169.253)Azure-provided DNS (168.63.129.16)Neither can be reached directly from on-premises
On-premises → cloudInbound endpointInbound endpoint of DNS Private ResolverSetting 168.63.129.16 as a forwarding target on-premises does not work
Cloud → on-premisesOutbound endpoint + forwarding rulesOutbound endpoint + DNS forwarding rulesetA ruleset takes effect only after it is linked to a VNet
Filtering and logsDNS Firewall, query logsDNS resolver policy (allow, block, alert, threat intelligence)Both decide by name
Traffic steering with DNSRouting policies + health checksTraffic ManagerThe Azure DNS zone itself has no steering feature
Diagram showing that the DNS parts of AWS and Azure (inbound endpoints, the resolver inside the VPC or VNet, private zones, outbound endpoints and forwarding rules, public zones, and filtering) map one to one by role

A common failure in Azure is forgetting to conditionally forward the privatelink.* zones for private endpoints from the on-premises DNS, so a public IP is returned. The same thing happens with AWS VPC endpoints. When “a cloud storage account is reached over the internet, but only from inside the company,” suspect this first.


AD-integrated DNS

This is the DNS of Active Directory, the representative corporate environment.

  • AD-integrated zones: The zone data is stored in the AD database and replicated to DCs by AD replication. Any DC can accept writes (multi-master), which is a different mechanism from the primary/secondary and zone transfers of Part 7
  • SRV records: The DC’s Netlogon service automatically registers records such as _ldap._tcp.dc._msdcs.<domain>, and clients find DCs by SRV (Part 6)
  • The _msdcs zone: _msdcs.<forest root> is replicated across the whole forest. If it cannot be resolved when finding DCs from a child domain or from a different DNS, domain join and authentication fail
  • Dynamic updates: Devices register their own A and PTR records. With “Secure only” dynamic updates, only the registered computer can modify its own records
  • DC DNS settings: A DC’s DNS list should have other DCs first and itself last. External names are consolidated through a forwarder to the caching DNS (Part 3)
$ dig +short SRV _ldap._tcp.dc._msdcs.corp.example.com
0 100 389 dc01.corp.example.com.
0 100 389 dc02.corp.example.com.

PS> Resolve-DnsName _ldap._tcp.dc._msdcs.corp.example.com -Type SRV
PS> nltest /dsgetdc:corp.example.com          # the DC actually found

Scavenging

One more thing to know about AD-integrated DNS is scavenging (automatic deletion of stale records).

Diagram showing the default scavenging values: a 7-day no-refresh interval after a record is registered, then a 7-day refresh interval, and a record not refreshed for 14 days is judged stale and becomes eligible for deletion, with notes on enabling and the interval

The defaults are a 7-day no-refresh interval plus a 7-day refresh interval, so a record that has not been refreshed for 14 days is judged stale. It does not run unless enabled on both the zone and the server, and if you set the interval to under 24 hours, records of live devices are deleted too. If records for retired servers or DCs keep lingering, check your scavenging settings.


DNS in Kubernetes

This is about the opening problem: “After moving to Kubernetes, calls to an external API got slow.”

Inside the cluster, CoreDNS acts both as an authoritative DNS that answers Service names and as a caching DNS that resolves external names. A Service can be resolved as <service-name>.<namespace>.svc.cluster.local.

A Pod’s /etc/resolv.conf (default dnsPolicy: ClusterFirst, example in namespace prod) looks like this:

nameserver 10.96.0.10
search prod.svc.cluster.local svc.cluster.local cluster.local
options ndots:5
Diagram showing that when looking up api.example.com, which has 2 dots and so fewer than ndots:5, three names with the search domains appended get NXDOMAIN for A/AAAA before the real name is queried, for up to 8 queries in all, and the fixes: a trailing dot, changing ndots, and NodeLocal DNSCache

What ndots:5 means: A name with fewer than 5 dots is first tried with the search domains appended. When you look up the external api.example.com, three names such as api.example.com.prod.svc.cluster.local get NXDOMAIN before the real name is queried, so there are up to 8 queries, counting A and AAAA (more if the node’s search list is added).

  • Impact: More queries to CoreDNS and the upstream DNS, and slower name resolution. On AWS you can also hit the 1,024 pps per-ENI limit
  • Fixes: Write external names as an FQDN with a trailing dot, lower ndots with the Pod’s dnsConfig (for example, to 2), place a cache on each node with NodeLocal DNSCache, and tune the CoreDNS replica count and cache

The “trailing dot” and “search domain” topics from Parts 2 and 3 are what matter here.


Why DNS matters for products such as vSphere

Finally, the relationship between infrastructure products and DNS. For many products, DNS is a prerequisite for deployment.

Diagram showing that matching forward (A) and reverse (PTR) records for vCenter Server is a prerequisite for building it, and that the name is built into certificates, single sign-on, ESXi host registration, email notifications, and Kerberos for NFS 4.1

In vSphere, the typical example, when you deploy vCenter Server by FQDN, it is a requirement that both the forward (A) and reverse (PTR) records are registered and match. If they don’t, deployment or first boot fails. The vCenter name is built into certificates and single sign-on, so changing it later is a big job.

There are other examples as well:

  • vCenter email notifications are not sent if the sender or recipient domain cannot be resolved in DNS (Broadcom KB 321441)
  • When you use Kerberos authentication for NFS 4.1 on ESXi, you need DNS that can find the KDC through SRV records

Kerberos checks the other party by name, and certificates are issued for names, so the same applies to many products. Names get baked into products, so rather than fixing them later, check the product’s DNS requirements before you build and register A and PTR records first.


Think about it

  1. In your AWS (or Azure) VPC, which DNS server do EC2 instances use? By what path are on-premises names resolved?
  2. Is scavenging enabled in your AD DNS? Think of a way to check whether records for retired servers or DCs remain.
  3. A Pod in Kubernetes runs an app that calls an external API 100 times per second. How many DNS queries per second would the ndots setting and the search list produce?

Hint: For question 1, think about the DHCP option set and forwarding rules. For question 2, think about timestamps and netlogon.dns. For question 3, think about the number of search domains and A/AAAA.


Summary

  • Route 53 has three roles: authoritative DNS, registrar, and VPC resolver. For public zones, delegation is complete when the 4 NS servers are registered with the parent
  • Routing policies only change the authoritative answer. They do not affect caches until the TTL expires
  • VPC Resolver returns NXDOMAIN for a name not in the matching zone
  • Hybrid uses conditional forwarders in both directions. Put the AWS side in a subdomain
  • AD-integrated DNS is multi-master. Know SRV, _msdcs, and scavenging
  • In Kubernetes, ndots:5 increases queries for external names. For vSphere, matching forward and reverse records is a prerequisite

Next time, we pull together what we have learned so far into the steps for isolating DNS failures.


Watch the video

This part is also explained in a YouTube video (about 19 min).

All parts of the series are in the DNS Fundamentals playlist on YouTube.

The DNS Fundamentals series (12 parts)

All 12 parts with a reading guide: DNS Fundamentals

  1. What Is DNS? How Name Resolution Works and Its Three Key Players
  2. The domain name hierarchy and delegation
  3. How name resolution works
  4. DNS messages and transport
  5. Resource records, part 1
  6. Resource records, part 2
  7. Running authoritative DNS servers
  8. Investigating with commands
  9. DNS security
  10. DNS in the cloud and on corporate networks (this article)
  11. DNS troubleshooting
  12. DNS design exercises

This series is the English edition of 【DNS入門】, originally written in Japanese.

コメント

Copied title and URL