AZ Affinity Routing in Route 53 - Which Record Answers and When It Falls Back

First Published:
Last Updated:

Amazon Route 53 introduced AZ affinity routing on November 20, 2026. This ninth routing policy examines the Availability Zone (AZ) from which a query originates and responds using records created specifically for that AZ. By directing traffic to endpoints in the same AZ, it's possible to reduce cross-AZ communication and latency.

This feature should not be misinterpreted as a simple "nearest record" function. Route 53 checks five levels—AZ, Zone Group, Region, Partition, and Global—in order, returning the first healthy record it finds. If there is no Global record, queries that match no record receive a NOERROR response with 0 answers (NODATA). A query does not fall back to the next level from a non-alias record without a health check. If all matching records are unhealthy, the most specific record is returned, even though it is unhealthy. Route 53 receives the AZ only from queries that come through VPC Resolver.

This article compiles information from the Route 53 developer guide, API reference, CloudFormation reference, What's New section, and Document History to clarify which records respond to which queries, under what conditions a query falls back to the next level, and where NODATA responses are returned. In addition, it presents empirical results obtained by querying a private hosted zone from VPC-connected Lambda functions placed in subnets in two AZs in us-east-1, alongside the rules on the pages. The checked date is December 2, 2026. This article does not cover zonal shift, comparisons with other routing policies, or pricing.

Related articles on this site:

Table of Contents

  1. 1. Scope and Assumptions
  2. 2. The Order of the Five Levels and What a Record Specifies
  3. 3. AZ IDs and Zone Groups
  4. 4. When a Query Falls Back to the Next Level, and When It Does Not
  5. 5. NODATA and Global Records
  6. 6. The Query Paths That Carry the AZ
  7. 7. What AZ-Affinity Routing Does Not Do, and Features with Similar Names
  8. 8. Demo: Answers Seen from VPC-Connected Lambda Functions
  9. 9. Frequently Asked Questions about AZ Affinity Routing
  10. 10. Summary
  11. 11. References

1. Scope and Assumptions

This chapter first defines the intended audience, the scope of this article, the referenced materials, the notation used, and the terminology. The following eight points outline the key conclusions:

  • When responding to queries for records with AZ affinity, Route 53 returns the first healthy record, prioritizing Availability Zone, Zone Group, Region, Partition, and Global, in that order. It skips levels that have no record (see Section 2).
  • The AZ level is specified with an AZ ID (such as use1-az1); AZ names (such as us-east-1a) cannot be used. Location IDs are written in lowercase. Local Zones, Wavelength Zones, and Outposts are not considered location types (see Section 3).
  • A query falls back to the next level under two conditions: the level has no record, or its record is unhealthy. A non-alias record without a health check is always considered healthy, so a query does not fall back past it (see Sections 4.1 and 4.2).
  • If all matching records are unhealthy, Route 53 returns the most specific of them, even though it is unhealthy. This differs from the general rule of other routing policies, which treat all records as healthy when all are unhealthy (see Section 4.3).
  • A query falls back only to records that you created at less specific levels. Falling back is not an automatic switch to a different Region (see Section 4.4).
  • If no record matches and there is no Global record, Route 53 returns a NOERROR response with 0 answers (NODATA), not NXDOMAIN. The documentation recommends always creating a Global record (see Section 5).
  • Route 53 receives the AZ only from queries that come through VPC Resolver. Queries originating from the internet only match Global records. The documentation uses EC2 instances as its example of a resource in a VPC and does not name Lambda functions. In this article's measurement, queries from VPC-connected Lambda functions also carried the AZ (see Sections 6 and 8).
  • Traffic Flow, the console's DNS verification tools, and the TestDNSAnswer API do not support records with AZ affinity. AZ affinity is not an access control mechanism. Availability Zone DNS affinity in NLB is a separate feature (see Section 7).

1.1 Intended Audience

This article is intended for architects and operators of multi-AZ configurations who want to steer traffic to endpoints in the same Availability Zone (AZ) to reduce cross-AZ traffic and latency. It is aimed at readers who know Route 53's latency, geoproximity, and failover routing policies, read AZ-affinity records as a feature that returns the nearest record, and have not yet checked what is returned in configurations without a Global record, for records without a health check, and for queries from outside the VPC.

1.2 Scope of Discussion and Exclusions

This article covers the order of the five levels, the AZAffinity settings, AZ IDs and Zone Groups, the conditions for falling back to the next level, NODATA and Global records, the paths that carry the AZ, what cannot be used, a different feature with the same spelling, the demo's measurements, and the checked date.

The following topics are not covered here; the listed article covers each:


Advanced Hosted Zones, public DNS fallback for private hosted zones, the details of health checks for private endpoints, Route 53 Global Resolver, and pricing are not covered.

1.3 Checked Date and Reviewed Materials

The checked date is December 2, 2026. This date falls during the re:Invent 2026 event (November 30 to December 4, 2026), and the pages referenced in this article may change during the event.

AWS What's New posts up to December 1, 2026, at 17:00 UTC were reviewed, and no Route 53 items were found after November 20, 2026.

The following five categories of documentation were reviewed:

CategoryRole in this ArticleReviewed Content
Route 53 Developer GuideAuthoritative description of behaviorAZ-affinity routing, Values specific for AZ-affinity records, Values specific for AZ-affinity alias records, Choosing a routing policy, How Amazon Route 53 chooses records when health checking is configured, Configuring failover in a private hosted zone
Route 53 API ReferenceValue formats and requirementsResourceRecordSet, AZAffinity, HealthCheckConfig, TestDNSAnswer
CloudFormation Template ReferenceValue formats and requirementsAWS::Route53::RecordSet and its AZAffinity
What's NewAnnouncement date and scopeAmazon Route 53 now supports Availability Zone (AZ) affinity routing (2026-11-20T08:21:00Z), Amazon Route 53 now supports health checks for private endpoints, Amazon Route 53 private hosted zones now support public DNS fallback
Document HistoryDocument change datesEntry for 2026-11-20

In addition, the following resources were reviewed: the EC2 API Reference (specifically the AvailabilityZone section), the Lambda Developer Guide (specifically the metadata endpoints), and the Elastic Load Balancing documentation (specifically the NLB attributes). At the time of verification, no official AWS blog posts explaining AZ-affinity routing were found.

1.4 Indicators of Information Source

This article uses the following four indicators for each piece of information:

IndicatorMeaning
StatedInformation explicitly stated in AWS documentation (developer guides, API references, CloudFormation references, What's New, Document history).
Not statedInformation not found in the documents reviewed for this article. This does not constitute proof of non-existence.
InferenceInformation derived by this article based on the content of the documents and on measurements.
MeasuredInformation obtained through this article's own testing (December 2, 2026, us-east-1, using one account). Results may vary depending on other regions, dates, or configurations.

1.5 Usage of Terms

This article distinguishes between the following terms:

  • Level (location type): Refers to one of five location types: Availability Zone, Zone Group, Region, Partition, and Global. The API name is LocationType.
  • Location ID: A value that identifies a specific location within a level. It takes the form use1-az1, us-east-1-zg-1, us-east-1, aws, or global. The API name is LocationId.
  • Match: Indicates that the Availability Zone (AZ) from the query is included in the location specified in the record.
  • Fall back to the next level (fall back to a less specific location): Refers to Route 53 answering with a record for a broader level instead of the record for the matching level. This article uses the term only in the sense used on the Route 53 pages.
  • Healthy: This term is used in three distinct contexts: when a health check result is healthy; when the "Evaluate target health" feature on an alias record determines the target to be healthy; and when non-alias records without health checks are always considered healthy.
  • NODATA: A response with a NOERROR status code, but with zero records returned. This is distinct from NXDOMAIN, which indicates that the name does not exist.
  • VPC Resolver: The default DNS server for VPCs. Previously known as Route 53 Resolver.

In this article, falling back to the next level is different from the fallback described in the companion article Why a System Stays Down After the Cause Is Gone - Cold Caches, Queue Backlogs, and Fallbacks on AWS, that is, an alternative path weaker than the primary path, used when the primary path fails. In AZ-affinity routing, falling back to the next level is one step in choosing a record.

2. The Order of the Five Levels and What a Record Specifies

This chapter shows, from the pages, the order in which an AZ-affinity record set answers and what a record specifies. At the end, a table compares how the sources describe the feature.

2.1 The Ninth Routing Policy, Added on November 20, 2026

What's New announced AZ affinity routing on November 20, 2026, at 08:21:00Z (Stated). The announcement stated that AZ affinity routing directs DNS queries from a VPC to resources in the same Availability Zone as the client, whereas previously, routing based on latency or geoproximity was used to minimize delay (Stated). This feature is available in all commercial AWS Regions that support both public and private Route 53 hosted zones (Stated). Records can be created using the console, API, AWS CLI, AWS SDK, or CloudFormation (Stated).

The "Choosing a routing policy" page in the developer guide now lists AZ affinity as the ninth option and notes that it is also available for private hosted zones (Stated). The November 20, 2026 entry in the document history also records the addition of AZ affinity routing (Stated). The difference between latency routing and AZ affinity routing lies in the criteria used for selection. Latency routing considers the delay from the user to the Region, while AZ affinity routing focuses on the Availability Zone from which the query originated (Inference). Determining which is superior is outside the scope of this article.

2.2 The Order of the Five Levels

The developer guide's page on AZ-affinity routing states the following regarding how Route 53 selects a response (Stated).

When Route 53 receives a query for an AZ-affinity record set, it responds with the first healthy record in the following order of location types, from most specific to least specific:

The page lists the following five levels in order (Stated):

  1. Availability Zone: The Availability Zone from which the query originated. Specified by AZ ID.
  2. Zone Group: Any Availability Zone in the Zone Group that contains the originating AZ. Specified by Zone Group ID.
  3. Region: Any Availability Zone in the specified Region. Specified by Region code.
  4. Partition: Any Region in the specified Partition. Specified by Partition name.
  5. Global: All other queries. This includes queries originating from the internet. Specified as global.

You do not have to create a record for every level. The page says that Route 53 skips a level that has no record (Stated).

Route 53 skips a level when you didn't create a record for the location at that level.

Figure 1 illustrates the search for a record, starting from the Availability Zone from which the query originated. At each level, if there is no record, the level is skipped. If the record is unhealthy, the search goes on to the next level. If a healthy record is found, Route 53 returns it. If all matching records are unhealthy, Route 53 returns the most specific record. If no record matches at all, Route 53 returns NODATA.

How an AZ-Affinity Query Finds Its Record
How an AZ-Affinity Query Finds Its Record

2.3 Table 1: What to Specify for Each Level

In both the API and CloudFormation, records specify LocationType and LocationId for the AZAffinity element (Stated). The console allows you to select locations from a list (Stated). Table 1 lists, for each level, the console name, the LocationType value, an example LocationId, and the queries it answers.

Level (Console)LocationTypeExample LocationIdResponds to Queries
Availability ZoneAvailabilityZoneuse1-az1Queries originating from that specific Availability Zone
Zone GroupAvailabilityZoneGroupus-east-1-zg-1Queries originating from any Availability Zone within that Zone Group
RegionRegionus-east-1Queries originating from any Availability Zone within that Region
PartitionPartitionawsQueries originating from any Region within that Partition
GlobalGlobalglobalAll other queries, including those from the internet

The valid values for LocationType are these five, as stated in both the API reference and CloudFormation (Stated). In the API, console Zone Groups are specified as AvailabilityZoneGroup (Stated).

The following YAML provides an example of creating one record at the AZ level and one at the Global level in CloudFormation. The names and values were made up for this article and are not taken from the pages.

AppRecordAz1:
  Type: AWS::Route53::RecordSet
  Properties:
    HostedZoneId: !Ref PrivateZone
    Name: app.example.internal.
    Type: A
    TTL: "60"
    SetIdentifier: az-use1-az1
    AZAffinity:
      LocationType: AvailabilityZone
      LocationId: use1-az1
    HealthCheckId: !Ref HealthCheckAz1
    ResourceRecords:
      - 10.0.1.10
AppRecordGlobal:
  Type: AWS::Route53::RecordSet
  Properties:
    HostedZoneId: !Ref PrivateZone
    Name: app.example.internal.
    Type: A
    TTL: "60"
    SetIdentifier: global
    AZAffinity:
      LocationType: Global
      LocationId: global
    ResourceRecords:
      - 10.0.2.10

2.4 Creating Record Sets

In AZ-affinity routing, you create one record of the same name and type for each location where you want to provide a response (Stated). Within a record set, the records should have the same name, type, and TTL (Stated). The console's Record ID and the API's SetIdentifier are values used to distinguish records within a record set (Stated).

The API reference for ResourceRecordSet states that when specifying AZAffinity, you must also specify a SetIdentifier, and you cannot assign other routing policy elements, such as Weight, to the same record (Stated). The developer guide states that you cannot create non-AZ-affinity records that have the same name and type as AZ-affinity records (Stated). When moving existing simple or weighted records to AZ-affinity routing, you cannot have records with the same name and type side by side, even temporarily (Inference). The migration process is not described in the documentation (Not stated).

The values for non-alias records can include A, AAAA, CAA, CNAME, MX, NAPTR, PTR, SPF, SRV, and TXT (Stated). When directing traffic to AWS resources, you create AZ-affinity alias records (Stated). Alias records support all record types except NS and SOA, and can point to another record in the same hosted zone, but not to a record in a different hosted zone (Stated).

2.5 How the Sources Describe the Feature Differently

While describing the same functionality, different documents present it in several different ways. This article considers the developer guide as the definitive source regarding behavior.

AspectDeveloper GuideAPI ReferenceCloudFormationWhat's New and Document History
Location Types5 (including Partition)5 Valid Values5 Allowed ValuesWhat's New lists 4: Availability Zone, Zone Group, Region, and Global. Document History names AZ, Zone Group, and Region, and says that Route 53 falls back down to a Global record.
LocationType and LocationId Requirements—The table indicates "Required: No," while the text states that both must be specified.Both are Required: Yes—
Queries Without AZ InformationQueries that do not come through VPC Resolver only match Global.Queries for which Route 53 does not know the originating AZ only match Global.Same wording as the API.What's New states that queries not originating from VPC are answered with Global records.
TestDNSAnswer IncompatibilityDescribed in Considerations.The TestDNSAnswer page does not mention AZ affinity.——

The fact that What's New does not list Partition is likely due to brevity in the announcement (Inference). The "Required: No" entry in the API table likely indicates that the AZAffinity element itself is optional, and that the text says, at a different layer, that both are needed when the element is specified (Inference). Neither of these interpretations is explicitly stated in the documents (Not stated).

3. AZ IDs and Zone Groups

This chapter explains why the AZ level is specified with AZ IDs, outlines the process for verifying AZ IDs and Zone Groups, and details locations that cannot be specified, along with the rules for lowercase characters.

3.1 Why Use AZ IDs, Not AZ Names

The developer guide says to specify the AZ level as follows (Stated).

Specify the AZ ID, such as use1-az1, not the Availability Zone name, such as us-east-1a. An Availability Zone name can map to a different Availability Zone in each AWS account.

AZ names may refer to different physical Availability Zones depending on the account. AZ IDs, however, always refer to the same location regardless of the account (Stated). In configurations where VPCs from multiple accounts are associated with a single private hosted zone, if you think in AZ names, a function in another account can appear to receive the record for a different AZ (Inference). Details regarding these mappings are discussed in Section 2 of Falsehoods AWS Architects Believe About Regions and Availability Zones.

3.2 Verifying AZ IDs and Zone Groups

The developer guide states that AZ IDs can be verified either in the EC2 dashboard under Service health, or by using the describe-availability-zones command (Stated). From within an EC2 instance, you can retrieve your AZ ID using the instance metadata's placement/availability-zone-id (Stated). The guide shows a command that lists Zone Groups alongside AZ IDs (Stated).

aws ec2 describe-availability-zones \
    --region us-east-1 \
    --filters Name=zone-type,Values=availability-zone \
    --query "AvailabilityZones[].[ZoneId,GroupName]" \
    --output text

The guide notes that in the output for us-east-1, a line lists use1-az1 and us-east-1-zg-1, indicating that use1-az1 belongs to Zone Group us-east-1-zg-1 (Stated). Removing the zone-type filter can also include Local Zones and Wavelength Zones that do not support AZ affinity (Stated). The EC2 API reference provides examples, listing AZ us-east-1-zg-1, Local Zone us-west-2-lax-1, and Wavelength Zone us-east-1-wl1-bos-wlz-1 as examples of groupName (Stated). The pages read for this article do not state how many Zone Groups a Region has (Not stated). In the us-east-1 Region of the account used in this article's demo, all six AZs (from use1-az1 to use1-az6) belonged to the us-east-1-zg-1 Zone Group (Measured).

Lambda functions can retrieve their AZ ID from the Lambda metadata endpoint (Stated). This article's demo used this endpoint. Details regarding the endpoint are provided in Section 6 of Metadata Endpoints Across AWS Compute - What Code on EC2, ECS, EKS, and Lambda Can Ask the Platform, How Each Endpoint Checks the Caller, and Where Location and Credentials Come From.

3.3 Locations That Cannot Be Specified, and the Lowercase Rule

The Developer Guide's Considerations section states that Local Zones, Wavelength Zones, and Outposts are not included as location types (Stated). The API reference states that Availability Zones and Zone Groups in the LocationId must be generally available, and that Zone Group, Region, and partition IDs must belong to a partition that you can use (Stated). A Local Zone ID cannot be specified for the AZ level, and a Local Zone group cannot be specified for the Zone Group level (Stated).

Location IDs are case-sensitive and should be entered in lowercase (Stated). They follow the format use1-az1, us-east-1-zg-1, aws, and global. The pages do not state whether the API rejects an AZ name or an uppercase ID, or accepts it and the record simply never matches (Not stated). In this article's demo, attempts to create records using an AZ name (us-east-1a) for the LocationId of an AZ, as well as attempts to use an uppercase ID (USE1-AZ1), were rejected with an InvalidInput error (Measured). Both error messages contained the following text (Measured):

The specified AZAffinity location is not generally available

The messages indicated that the error was not due to an incorrect format, but rather that the specified location was not a generally available location (Inference).

4. When a Query Falls Back to the Next Level, and When It Does Not

This chapter describes the conditions under which Route 53 falls back to the next level, the conditions under which it does not, the answer when all matching records are unhealthy, how far falling back reaches, and health checks in private hosted zones.

4.1 Two Conditions for Falling Back

The ResourceRecordSet in the API reference states that Route 53 begins by matching queries to the most specific location and, when a record is not found at that location or the record is unhealthy, it falls back to a broader location (Stated). An unhealthy record is defined as one where the health check has failed, or where the record is an alias with EvaluateTargetHealth set to true and the target is unhealthy (Stated).

Falling back only reaches levels that contain the AZ the query came from. The developer guide's values page says that from an unhealthy record, Route 53 falls back to the next level for which you created a record, in the order of that AZ's Zone Group, Region, partition, and then Global (Stated). For example, if records are created only at the AZ and Region levels, a query from an AZ that has no AZ record skips the Zone Group level and receives the Region record (Inference). In this article's demo, the use1-az2 function received the Region record in this configuration (Measured, Section 8.2).

4.2 Records Without a Health Check Do Not Fall Back

The developer guide describes how Route 53 treats a non-alias record that has no health check (Stated).

If a non-alias record doesn't have a health check, Route 53 always considers the record healthy, which will prevent falling back to a less specific location.

If you do not associate a health check with an AZ-level record, queries from that AZ keep receiving the same record even when the endpoint in that AZ stops (Inference). In this article's demo, too, the AZ record without a health check kept being returned even though a healthy Region record existed (Measured, Section 8.2). The values page recommends configuring health checks for each AZ-affinity record (Stated). Route 53 does not verify the health of the record's value (e.g., the IP address of an A record); it only verifies the health of the endpoint specified in the health check (Stated).

An alias record is considered unhealthy because of its alias target only when Evaluate target health is set to Yes (Stated). With No, a query does not fall back past the record even when the target is unhealthy. If a health check is associated while it is set to No, the query falls back when that health check is unhealthy (Stated). The documentation states that when an AZ-affinity alias record points to a non-alias record in the same hosted zone, a health check should also be configured for the record being pointed to (Stated).

4.3 When All Matching Records Are Unhealthy

The developer guide describes the answer when all matching records are unhealthy (Stated).

If all the records that match where the query comes from are unhealthy, Route 53 responds with the most specific of those records, even though it's unhealthy.

This rule differs from the behavior of other routing policies. The page "How Amazon Route 53 chooses records when health checking is configured" specifies the behavior for each routing policy as follows (Stated):

Routing PolicyResponse When No Healthy Records are Available
General rule (weighted and others)Treats all records in the set as healthy and selects one based on the routing policy and value.
FailoverReturns the primary record if both the primary and secondary records are unhealthy.
AZ affinityReturns the most specific of the matching records.

In AZ-affinity routing, all matching records are unhealthy only when every matching record, up to the Global level, is unhealthy. If a Global record is configured without health checking, it is always considered healthy, so it is not possible for all matching records to be unhealthy. In such a scenario, the Global record responds if all records at other levels are unhealthy (Inference). In this article's demo, when the AZ and Region records were unhealthy and a Global record without a health check existed, the Global record answered (Measured, Section 8.2). Whether to configure a health check on the Global record depends on the desired behavior (Inference).

4.4 Falling Back Stays Within the Five Levels

Falling back to the next level means answering with a record that you created at a less specific level, not switching automatically to an endpoint in a different Region (Inference). The value of that record determines the endpoint in the answer. If a Region-level record points to an endpoint in another AZ of the same Region, the answer changes inside the same Region. If a Partition-level or Global record specifies an endpoint in a different Region, that endpoint will be returned (Inference).

The Partition level answers queries from any Region in that partition (Stated). The developer guide says to use a Partition record as the catch-all for queries that come from AWS Regions, and a Global record for queries from the internet (Stated). When VPCs in several Regions are associated with one hosted zone, a query from a VPC in another Region matches the Partition or Global record if there is no record at that Region's level (Inference).

There is a separate mechanism for excluding Availability Zones. ARC's zonal shift feature removes addresses from specific Availability Zones within ALB or NLB DNS records. Its behavior is detailed in Draining an Availability Zone for Days. The behavior when combining AZ affinity records and zonal shift is not stated in the pages read for this article (Not stated).

4.5 Health Checks in Private Hosted Zones

The page on configuring failover for private hosted zones states that Route 53 health checkers are outside the VPC, so checking an endpoint in a VPC by IP address requires a public IP address (Stated). The same page also mentions that health checks based on CloudWatch metrics and alarms can be used to verify endpoints that only have private IP addresses (Stated).

On November 19, 2026, support for health checks for private endpoints was also announced (Stated). The announcement says that these health checks can be associated with records in private hosted zones across routing policies (Stated). The details of the mechanism and configuration are outside the scope of this article. The process by which health checks are evaluated is detailed in Sections 1 and 6 of the Route 53 Health Check and Failover.

5. NODATA and Global Records

This chapter explains what is returned when a query doesn't match any existing records, and outlines the reasons for creating Global records.

5.1 NODATA Is Not NXDOMAIN

The developer guide describes the answer when no record matches (Stated).

If no record matches where the query comes from and you didn't create a Global record, Route 53 responds with no records (a NOERROR response that contains no answers, also known as NODATA).

A NODATA response has a NOERROR response code and contains zero records. NXDOMAIN is a different response code that indicates the queried name does not exist. The answer to a query that matches no AZ-affinity record does not say that the name does not exist (Stated).

For example, if you only create records for AZ A and do not create a Global record, a query originating from AZ B will receive a NODATA response (Inference). In this article's demo, the use1-az2 function received a NOERROR response with zero records, while queries for names without records received an NXDOMAIN response (Measured, Section 8.2). Many applications treat NODATA as a failure to resolve the name (Inference). How clients differentiate between NODATA and NXDOMAIN is dependent on their specific implementation (Inference).

5.2 Reasons for Creating a Global Record

The developer guide recommends always creating a Global record (Stated).

We recommend that you always create a Global record so that every query gets an answer.

The API reference states that Route 53 responds with a Global record when a query does not match a more specific record, or when it is the only healthy record that matches (Stated). The Global level is the only level that answers queries that do not carry an AZ (Stated).

5.3 The Value of the Global Record

The Global record is returned for queries where AZ information is not received, for queries that match no other level, and for queries when all records at the other levels are unhealthy and the Global record is healthy (Inference). In public hosted zones, queries originating from the internet will only resolve to the Global record (Stated). In that design, the value that you want to return to internet users goes in the Global record (Inference). The pages do not recommend what value to put in the Global record (Not stated).

6. The Query Paths That Carry the AZ

This chapter describes the paths by which the AZ a query came from reaches Route 53, and the paths by which it does not.

6.1 Queries That Come Through VPC Resolver

The developer guide states that when resources within a VPC (for example, an EC2 instance) resolve DNS names using VPC Resolver, VPC Resolver forwards the Availability Zone (AZ) from which the query originated to Route 53 (Stated). This applies to both public and private hosted zones (Stated). In private hosted zones, Route 53 only responds to queries originating from the associated VPC, which is consistent with how it handles other records (Stated).

Figure 2 illustrates the paths that carry the AZ and the paths that do not. Queries originating from a subnet in the VPC and passing through VPC Resolver are delivered to Route 53 along with the AZ. Conversely, queries from internet resolvers and those sent directly to Route 53 name servers do not carry the AZ and match only the Global record.

Which Queries Carry an Availability Zone
Which Queries Carry an Availability Zone

6.2 Queries That Do Not Come Through VPC Resolver

The developer guide describes how queries that don't come through VPC Resolver are handled (Stated).

Queries that don't come through VPC Resolver match only the Global record.

The documentation provides examples, including queries originating from the internet and queries sent directly to Route 53 name servers by DNS resolvers (Stated). Even if you create AZ-affinity records in a public hosted zone, users accessing from the internet will receive the value of the Global record; if no Global record exists, the response will be NODATA (Inference). AZ affinity does not direct internet users to a specific Availability Zone (Inference).

6.3 Callers the Pages Do Not Name

The documentation only provides examples using EC2 instances within a VPC, and the testing methods are described using dig commands executed from an EC2 instance (Stated). Whether queries from VPC-connected Lambda functions, ECS tasks, EKS Pods, and other callers carry the AZ is not stated by name on the pages read for this article (Not stated). This article's demo checked this with VPC-connected Lambda functions, and the AZ was carried (Measured, Section 8.3).

The documentation does not address how queries from on-premises environments that pass through the Resolver inbound endpoint, or configurations that specify a different DNS server in the VPC's DHCP option set, are handled in terms of AZ identification (Not stated). The section on VPC Resolver availability states that queries from instances are typically sent to a Zonal Resolver fleet in the same AZ (Stated). Reading this path as the source of the AZ information is only this article's inference (Inference). VPC Resolver limits and logging are covered in What Limits DNS Queries in an Amazon VPC.

7. What AZ-Affinity Routing Does Not Do, and Features with Similar Names

This chapter describes what cannot be used with AZ affinity records, explains that it is not access control, and describes other features with the same spelling or the same word.

7.1 What Cannot Be Used

The developer guide's "Considerations" section lists five items. Of these, three items cannot be used with AZ-affinity records (Stated). The remaining two are the lowercase location IDs (Section 3.3) and the fact that AZ-affinity routing is not access control (Section 7.2).

  • Traffic Flow traffic policies do not support routing with AZ affinity.
  • Local Zones, Wavelength Zones, and Outposts are not considered valid location types (Section 3.3).
  • The console's DNS verification tools and the TestDNSAnswer API are not compatible with AZ affinity records.

The incompatibility of TestDNSAnswer is documented only in the developer guide's "Considerations" section. The TestDNSAnswer page in the API reference does not mention AZ affinity (Not stated). The page describes a testing method that involves running dig from an EC2 instance in the AZ where the record was created, ensuring that queries are sent to VPC Resolver rather than the authoritative name server for the hosted zone (Stated).

7.2 Not an Access Control Mechanism

The developer guide states that AZ affinity is not an access control mechanism (Stated).

AZ-affinity routing chooses which record to respond with, but it doesn't restrict who can get a record. Don't use it to keep a record's value private.

The value of an AZ-level record appears to be returned only to queries from that AZ. However, this is a matter of how the response is selected, not a mechanism for concealing the value (Inference).

7.3 NLB Availability Zone DNS Affinity

Network Load Balancer offers another feature called Availability Zone DNS affinity (Stated). The NLB attributes page lists three client routing policies: Availability Zone affinity (100 percent zonal affinity), Partial Availability Zone affinity (85 percent zonal affinity), and Any Availability Zone (0 percent zonal affinity, the default) (Stated). This attribute determines which NLB address is returned to clients when they resolve the NLB's DNS name (Stated). It is not a routing policy for records you create within Route 53's hosted zones (Inference). The same page also states that this attribute only applies to clients resolving the NLB's DNS name through Route 53 Resolver (Stated). The condition is similar in form to the one for Route 53's AZ affinity (Inference). The history and background of this NLB attribute can be found in AWS History and Timeline regarding Elastic Load Balancing - Overview, Load Balancer Types, Features, Summary of Updates, and Introduction to ELB.

7.4 Public DNS Fallback

On November 20, 2026, the public DNS fallback feature for private hosted zones was also announced (Stated). This feature returns answers from public DNS when a private hosted zone does not contain a matching name, instead of NXDOMAIN, and is part of Advanced Hosted Zones (Stated). While the term "fallback" is used, it is a different feature from falling back to the next level in AZ-affinity routing. This article will not cover that feature.

8. Demo: Answers Seen from VPC-Connected Lambda Functions

This chapter details the setup for the demo presented in this article, outlines the answers for each scenario, and discusses whether the Lambda functions' queries carried the AZ and what this measurement cannot show.

8.1 Setup

The demo created the following resources in us-east-1 on December 2, 2026:

  • One VPC, containing a single subnet in each of two Availability Zones (use1-az1 and use1-az2), without a NAT Gateway or Internet Gateway, or VPC endpoints.
  • One Lambda function in each subnet, configured for VPC connectivity and using Python and the arm64 architecture.
  • One private hosted zone associated with the VPC, and 23 AZ-affinity TXT records across 10 names.
  • Two calculated health checks. A calculated health check with a HealthThreshold of 0 is always considered healthy (Stated). One was created without child health checks, and a second one with the same settings plus Inverted served as the always-unhealthy health check. A calculated health check without child health checks could be created, and CloudWatch showed a HealthCheckStatus of 1 for the first health check and 0 for the second (Measured).

Each TXT record contained a value including the scenario name, the level, the location ID, and whether a health check was present. Each function retrieved its AZ ID from the Lambda metadata endpoint, and then sent DNS queries built with the Python standard library to the servers listed in /etc/resolv.conf, the VPC CIDR +2 address, and 169.254.169.253, and recorded the response code, the answer count, and the TXT value. Each function was invoked three times, 60 seconds apart. The expected responses were calculated based on the rules outlined in the developer guide.

8.2 Table 2: Answers for Each Scenario

Table 2 lists the records created for each name, along with the responses received from two functions. The answer columns show the level of the TXT record returned. For each name, the same response was returned across all three calls and all three destinations (Measured).

NameCreated Records (Health Check)use1-az1 Function Responseuse1-az2 Function Response
all-levelsAZ (use1-az1), AZ (use1-az2), Zone Group, Region, Partition, Global (all without health check)AZ (use1-az1)AZ (use1-az2)
skip-azAZ (use1-az1), RegionAZ (use1-az1)Region
no-globalAZ (use1-az1) onlyAZ (use1-az1)NOERROR, 0 answers (NODATA)
zone-groupZone Group (us-east-1-zg-1), GlobalZone GroupZone Group
partitionPartition (aws), GlobalPartitionPartition
global-onlyGlobal onlyGlobalGlobal
hc-fallsAZ (use1-az1, unhealthy), Region (healthy)RegionRegion
no-hc-staysAZ (use1-az1, no health check), Region (healthy)AZ (use1-az1)Region
all-unhealthyAZ (use1-az1, unhealthy), Region (unhealthy)AZ (use1-az1, unhealthy)Region (unhealthy)
all-unhealthy-globalAZ (use1-az1, unhealthy), Region (unhealthy), Global (no health check)GlobalGlobal
missingNo recordNXDOMAINNXDOMAIN

All 198 responses (two functions, 11 names, three destinations, three calls) matched the answers calculated based on the rules in the developer guide (Measured). The following can be observed from Table 2.

  • With skip-az, the use1-az2 function skipped the Zone Group level and received the Region record. Levels without a record were skipped (Measured).
  • With no-global, the use1-az2 function received NOERROR with 0 answers. The name missing resulted in an NXDOMAIN response. NODATA and NXDOMAIN were returned as separate responses (Measured).
  • hc-falls and no-hc-stays differ only in the AZ record's health check. From the AZ record with an unhealthy health check, the query fell back to the Region level, while the AZ record without a health check was returned as is (Measured). Since the endpoints in this demo do not exist, this shows the behavior based on the presence and status of the health check, rather than the behavior when the endpoint fails.
  • With all-unhealthy, the use1-az1 function received the unhealthy AZ record, while the use1-az2 function received the unhealthy Region record. In both cases, the most specific matching record was returned. With all-unhealthy-global, the Global record without a health check answered (Measured).
  • The AA bit (Authoritative Answer) in the responses was 0 for all three destinations (Measured). This indicates that each destination responded as a resolver, rather than as a name server for the hosted zone (Inference).

8.3 Did the Lambda Functions' Queries Carry the AZ?

In this measurement, queries from the VPC-connected Lambda functions carried the AZ (Measured). The deciding case is all-levels. If the AZ were not carried, the query would match only the Global record. In fact, the function in use1-az1 received the use1-az1 record, and the function in use1-az2 received the use1-az2 record.

The /etc/resolv.conf file for both functions pointed to 169.254.100.5 (Measured). This address is neither the +2 address of the VPC's CIDR (10.20.0.2) nor 169.254.169.253. The pages read for this article do not say what this address is (Not stated). Regardless of which of the three destinations the query was sent to, the response was the same (Measured). As long as the function's code uses the default name resolution, the query is sent to 169.254.100.5 (Inference). The AWS Lambda developer guide does not state whether DNS queries from VPC-connected functions carry the AZ for AZ-affinity routing (Not stated). This result is a record from a single test and is not a guaranteed specification.

8.4 What This Measurement Cannot Show

This measurement reflects data from a single account, in the us-east-1 Region, utilizing two Availability Zones, and covering a single day. Because all six Availability Zones within this account's us-east-1 region belong to the same Zone Group, the Zone Group level and the Region level cover the same AZs, so this measurement cannot check the difference between the two levels (Inference).

Queries that do not come through VPC Resolver (such as queries from the internet) were not tested. Furthermore, this measurement does not extend to other Regions, other calling sources (such as ECS, EKS, or on-premises environments), public hosted zones, or alias records (Inference).

Response times were not measured, and this data cannot be used for latency comparisons. While AZ IDs are consistent across all accounts, the available AZ IDs vary depending on the account and Region (Inference). The pages do not state how many Zone Groups a Region has (Section 3.2).

9. Frequently Asked Questions about AZ Affinity Routing

Q1. Do I have to create Global records?

If you don't, queries that match no level receive NODATA. The developer guide recommends always creating Global records to ensure that all queries receive a response.

Q2. If an endpoint stops, does a query fall back to the next level even without a health check?

Not for a non-alias record. Route 53 always considers non-alias records without health checks to be healthy. For an alias record, a query falls back only when Evaluate target health is set to Yes or when a health check is associated.

Q3. If all matching records are unhealthy, will Route 53 consider them all healthy?

No, this doesn't apply to AZ affinity. Even if they are unhealthy, it will return the most specific matching record. Considering all records healthy is a general rule for other routing policies.

Q4. When a query falls back to the next level, does it switch to a different Region?

No, it doesn't switch automatically. It falls back to the record that you created at a less specific level. If that record points to an endpoint in a different Region, that endpoint will be returned.

Q5. If I create records in a public hosted zone, will internet users also be directed to the same AZ?

No. Queries that don't come through VPC Resolver only match Global records. Queries from the internet fall into this category.

Q6. Can I specify an AZ name, such as us-east-1a, in an AZ-level record?

No. The developer guide specifies that you should use the AZ ID in lowercase, rather than the AZ name. An AZ name can refer to a different AZ in each account. In this article's measurement, both the AZ name us-east-1a and the uppercase AZ ID USE1-AZ1 were rejected at the time of creation.

Q7. Does this work with queries from Lambda functions connected to a VPC?

The developer guide doesn't specifically mention Lambda functions. In this article's measurement, queries from VPC-connected Lambda functions carried the AZ. Two Lambda functions, each in a different AZ, received records corresponding to their respective AZs. This is based on a single test and is not a guaranteed specification.

Q8. Can I test this using tools like TestDNSAnswer or the console's DNS verification tools?

Neither of these tools supports AZ-affinity records. The developer guide recommends testing by querying VPC Resolver from an EC2 instance in the AZ where you created the record, using tools like dig.

10. Summary

AZ affinity routing is not a function that returns records that are "close," but rather a rule that checks five levels in order and returns the first healthy record found. The edges of the rule define the design.

ScenarioRoute 53 ResponseIndicator
A matching level has a recordThe healthy record at the most specific level.Stated
A level has no recordThat level is skipped.Stated
Records are unhealthyThe record at the next level that you created.Stated
Non-alias records without a health checkAlways considered healthy; the query does not fall back past it.Stated
All matching records are unhealthyThe most specific record, even though it is unhealthy.Stated
No match found, and no Global recordsNOERROR with 0 answers (NODATA).Stated
Queries that do not come through VPC ResolverOnly matches Global records.Stated
Queries from Lambda functions connected to a VPCIn this measurement, the AZ was carried, and each AZ's function received the record for its own AZ.Measured

  • Write the AZ level with the AZ ID, in lowercase. Local Zones, Wavelength Zones, and Outposts are not supported.
  • Each AZ affinity record should have a health check configured. For alias records, set "Evaluate target health" to Yes.
  • Global records should be created. The behavior when all records are unhealthy depends on whether the Global records have a health check configured.
  • Falling back to the next level is not an automatic switch to a different Region. The value of the record that you created determines the destination.
  • Traffic Flow, TestDNSAnswer, and the console's DNS verification tools cannot be used. AZ affinity is not an access control mechanism.
  • This article is based on documentation read on December 2, 2026, and measurements taken on the same day in us-east-1. It was during the re:Invent 2026 conference, and the pages may change.

11. References



References:
Tech Blog with curated related content

Written by Hidekazu Konishi