Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question
1  
Can you provide the output from dig -4 google.com and dig -6 google.com? Which name servers are you using to resolve requests from this system? –  Shane Madden Aug 31 '12 at 15:11
3  
by thinking out loud why dig was failing in both cases even for a machine not affected by this problem I found the problem: my first nameserver is bullshit, thanks! –  jolivier Aug 31 '12 at 15:30
2  
Great! Feel free to put an answer on your own question (there's an enforced delay, later today it should let you), as reference for people who have the same issue in the future. –  Shane Madden Aug 31 '12 at 15:32

1 Answer 1

up vote 1 down vote accepted

I solved this problem with the following diagnostic process, which can be applied when dealing with name resolution problems and ipv6

  • Test dig google.com and dig -4 google.com, on a machine having this problem and another one on the same network not having this problem.
  • If the four command (two by machine) fail, this mean that the first nameserver in their /etc/resolv.conf is not configured for ipv6. Remove it and retest.

One cal also use digg @nameserver google.com to test the other eventual nameservers in /etc/resolv.conf without changing this file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.