- Newest
- Most votes
- Most comments
The AZ DNS Affinity feature is for internal NLBs. This won't do anything for clients coming over the internet.
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
Relevant content
- asked 6 months ago
- asked 4 years ago
- asked 2 years 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.