Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 works, curl -4 works, but not curl

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 and dig -4 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!



share|improve this question
Can you provide the output from dig -4 and dig -6 Which name servers are you using to resolve requests from this system? – Shane Madden Aug 31 '12 at 15:11
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
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
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 and dig -4, 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 to test the other eventual nameservers in /etc/resolv.conf without changing this file.

share|improve this answer

Your Answer


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.