Name resolution not working with ipv6 on centos

Posted by jolivier on Server Fault See other posts from Server Fault or by jolivier
Published on 2012-08-31T15:02:55Z Indexed on 2012/08/31 15:41 UTC
Read the original article Hit count: 381

Filed under:
|
|

I just installed CentOs 6.3 on a server to be installed in a data center, but cannot get name resolution / curl to work.

I know this is because of it trying to use ipv6, since ping google.com works, curl -4 google.com works, but not curl google.com.

I removed the ipv6 adress from the interface and it does not change anything.

This is very problematic since most system tools like yum fail at name resolution currently. Browsers like Firefox work because they might be using another tool for name resolution than the one use by curl.

I managed to fix this on workstations by completely disabling ipv6 following tutorials like this one / hardcoding name resolution in /etc/hosts. But since I am here configuring a server which will be later installed in a remote data center, I would like not to mess up, understand what is going on and fix it properly. Besides, I will face the same issue with more servers to come so I would really appreciate your help in understanding this problem and how to solve it.

I would be happy to provide more information if needed to help understand what is going on.

The current network configuration is a small enterprise network, with a DNS server (let's call it A) configured once a long time ago. dig google.com and dig -4 google.com are both refused by the A DNS. But this is also true for my workstation on which curl is working (and yes they both use the same A DNS server). Indeed this faulty server and my workstation have multiple nameservers in /etc/resolv.conf, and the second one is working fine for both of them, so if I remove A from my resolv.conf everything works fine!

Regards,

Olivier

© Server Fault or respective owner

Related posts about centos

Related posts about IPv6