Skip to content

AWS NLB AZ DNS affinity

0

Dear Team,

question on AWS Network load balancer. As per https://docs.aws.amazon.com/elasticloadbalancing/latest/network/edit-load-balancer-attributes.html#zonal-dns-affinity,

Availability Zone DNS affinity

When using the default client routing policy, requests sent to your Network Load Balancers DNS name will receive any healthy Network Load Balancer IP addresses. This leads to the distribution of client connections across the Network Load Balancer's Availability Zones. With the Availability Zone affinity routing policies, client DNS queries favor Network Load Balancer IP addresses in their own Availability Zone. This helps improve both latency and resiliency, as clients do not need to cross Availability Zone boundaries when connecting to targets.

Does it mean, this feature of AZ DNS affinity useful for internal network load balancer only ? will this works for internet-facing NLB as well? if yes how it determine AZ from internet client ?

2 Answers
0
Accepted Answer

The AZ DNS Affinity feature is for internal NLBs. This won't do anything for clients coming over the internet.

AWS
EXPERT
answered a year ago
EXPERT
reviewed a year ago
  • Thank you very much. Do you have any reference document that mentioned this specifically ?

  • It is not explicitly called out in any of the docs.

-1

The Availability Zone DNS affinity feature works for both internal and internet-facing Network Load Balancers, but with different behaviors depending on the client location.

For internal NLBs, when clients are within your VPC, the DNS resolution can effectively determine which Availability Zone the client is in, allowing for true zonal affinity where clients connect to NLB nodes in their own AZ.

For internet-facing NLBs, the feature still functions but works differently. Since internet clients are outside your AWS infrastructure, the system cannot determine their exact Availability Zone. Instead, the DNS routing policy will distribute connections across the NLB's Availability Zones based on the selected affinity percentage:

  • With 100% zonal affinity (availability_zone_affinity), DNS queries will consistently return the same AZ's IP addresses for a given client
  • With 85% affinity (partial_availability_zone_affinity), DNS queries will favor certain AZs for specific clients but with some distribution
  • With 0% affinity (any_availability_zone), DNS queries will distribute evenly across all AZs

The primary benefits of using AZ affinity with internet-facing NLBs are connection consistency and potentially reduced cross-AZ data transfer costs, rather than true proximity-based routing. When using Availability Zone affinity, it's recommended to turn off cross-zone load balancing to ensure traffic remains within the same Availability Zone.
Sources
Network Load Balancers - Elastic Load Balancing
Edit attributes for your Network Load Balancer - Elastic Load Balancing
LoadBalancerAttribute - Elastic Load Balancing

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.