[CentOS] /etc/gai.conf fails to prefer IPv4 over IPv6 for NFS

Fri Jun 8 19:25:19 UTC 2018
Gordon Messmer <gordon.messmer at gmail.com>

On 06/08/2018 10:42 AM, Steve Rikli wrote:
> I found posts from others in a similar situation, and proposed solutions
> included modifying /etc/gai.conf to use:
>     precedence ::ffff:0:0/96  100

 From my reading of that file, you'd need to uncomment all of the 
default precedence lines, and modify the last one.  You couldn't use 
that one line, alone.  It's hard to tell if that's what you did. 
/etc/gai.conf would contain:

precedence  ::1/128       50
precedence  ::/0          40
precedence  2002::/16     30
precedence ::/96          20
precedence ::ffff:0:0/96  100

...also of note is that gai.conf should only affect the getaddrinfo() 
API.  If the client is using an older API like gethostbyname(), it won't 
order DNS results correctly.