Round-robin DNS broken by getaddrinfo in Red Hat Enterprise Linux
Issue
- DNS hostname lookups handled by the
getaddrinfo
(3) glibc function are no longer returned in "random" order when multiple A record answers are available in DNS. - Answers are sorted so some IP addresses are always returned first, thus "breaking" round-robin DNS.
- This may also apply to entries in
/etc/hosts
if there are multiple entries for the same host. - Glibc resolver
getaddrinfo()
, rsh, and ssh do not try IP addresses in the order defined in /etc/hosts. - How do I disable IPV4 sorting enforced by RFC-3484?
- How do I use the
scopev4
directive in/etc/gai.conf
to disable IPV4 sorting? - Is there a
sortv4 off
keyword option for/etc/gai.conf
?
Environment
- Red Hat Enterprise Linux 4 Update 5 or later
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- Multiple DNS A records for a hostname or multiple entries in /etc/hosts for a hostname
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.