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/hostsif 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
scopev4directive in/etc/gai.confto disable IPV4 sorting? - Is there a
sortv4 offkeyword 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 of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
