How Do You Keep NLB Traffic in the Same AZ While Allowing Failover?

A company has deployed an application in which the front end of the application communicates with the backend instances through a Network Load Balancer (NLB) in the same VPC. The application is highly available across two Availability Zones. The company wants to limit the amount of traffic that travels across the Availability Zones. Traffic from the front end of the application must stay in the same Availability Zone unless there is no healthy target in that Availability Zone behind the NLB. If there is no healthy target in the same Availability Zone, traffic must be sent to the other Availability Zone. Which solution will meet these requirements?

  1. Create a private hosted zone with weighted routing for each Availability Zone. Point the primary record to the local Availability Zone NLB DNS record. Point the secondary record to the Regional NLB DNS record. Configure the front end of the application to perform DNS lookups on the local private hosted zone records.
  2. Turn off cross-zone load balancing on the NLConfigure the front end of the application to perform DNS lookups on the local Availability Zone NLB DNS record. Source Reference Answer
  3. Create a private hosted zone. Create a failover record for each Availability Zone. For each failover record, point the primary record to the local Availability Zone NLB DNS record and point the secondary record to the Regional NLB DNS record. Configure the front end of the application to perform DNS lookups on the local private hosted zone records.
  4. Enable sticky sessions (session affinity) so that the NLB can bind a user’s session to targets in the same Availability Zone.

Community Votes

B
67%
C
33%

67% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

This question tests whether you know the built-in failover behavior of an NLB when cross-zone load balancing is disabled, rather than relying on DNS-level failover policies.

The correct solution is to disable cross-zone load balancing on the NLB and have the front end use the local AZ NLB DNS record. This keeps traffic local unless no healthy targets exist in the AZ, at which point the NLB automatically sends traffic to healthy targets in the other AZ.

Many candidates choose C because they think Route 53 failover records are needed to redirect traffic to the other AZ. They miss that the NLB already does this when cross-zone load balancing is off, making DNS failover unnecessary and over-engineered.

Community Discussion (5 comments)

c1193d4 👍 3 Selected: C
If B: I don't see how the failover would work if cross-zone load-balancing is OFF and only the AZ NLB endpoint is used A better solution would be to tweek the "AZ routing configuration" to "AZ affinity" but it's not describe as a solution
AzureDP900 👍 1 Selected: B
By disabling cross-zone load balancing, traffic will only be routed within the same Availability Zone unless there are no healthy targets available in that zone. This ensures that traffic from the front end of the application stays within the same Availability Zone unless necessary.
cas_tori 👍 1 Selected: B
this is B
aragon_saa 👍 2 Selected: B
Answer is B
Cacheirez 👍 2 Selected: B
By disabling cross-zone load balancing on the NLB, the NLB will only route traffic to targets within the same Availability Zone as the incoming request. If no healthy targets exist in the local AZ, the NLB will route the traffic automatically to targets in another AZ.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Correct Answer: B

Turn off cross-zone load balancing on the NLB and configure the front end to use the local Availability Zone NLB DNS record.

Why B Is Correct

When cross-zone load balancing is disabled, each NLB node routes traffic only to targets in its own Availability Zone. If there are no healthy targets in that Availability Zone, the NLB node automatically forwards traffic to healthy targets in the other Availability Zone. This behavior exactly matches the requirement: traffic stays in the same AZ whenever possible, and fails over only when the local AZ has no healthy targets.

The second part of the answer, using the local AZ NLB DNS record, ensures that the front-end instances resolve the NLB node IP in their own AZ. If the front end used the regional NLB DNS name, it might resolve to a node in the other AZ, causing unnecessary cross-AZ traffic before the NLB even processes the request.

Why C Is Not The Best Choice

Option C adds Route 53 failover records with a private hosted zone. This is over-engineered because the NLB already performs health-based failover at the load balancer level. Failover records rely on DNS health checks and add latency due to DNS TTL. They also test the DNS endpoint, not the health of the backend targets, so they do not accurately reflect the requirement of failing over only when there is no healthy target in the AZ.

Why A And D Are Incorrect

Option A uses weighted routing, which cannot guarantee that all traffic stays in the same AZ. Weighted routing sends a configured percentage of traffic to each target; it does not check backend health for the AZ-local behavior described in the question.

Option D uses sticky sessions (session affinity), which only keeps a user’s session on the same backend target. It does not control which AZ receives the traffic and can actually maintain sessions on a target in a different AZ, increasing cross-AZ traffic.

Community Consensus

The community vote strongly favors B (67 votes) over C (33 votes). As one candidate noted, disabling cross-zone load balancing means traffic is routed only within the same AZ unless no healthy targets are available, which is exactly what the requirement asks for.

Official Reference

Exam Strategy

Look for phrasing like 'stay in the same Availability Zone unless no healthy target' — this maps directly to NLB’s cross-zone load balancing disabled behavior. Avoid choosing DNS-based failover solutions when the load balancer itself can handle the failover automatically.

Related Analysis

Practice All ANS-C01 Questions

Access 137 questions with complete answers and detailed explanations.

View Full ANS-C01 Practice Test →

← Back to ANS-C01 Study Guide