Round-robin DNS broken by getaddrinfo in Red Hat Enterprise Linux

Solution Verified - Updated -


  • 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?


  • 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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content