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 have a CentOS 6 x86 server. If I ping 8.8.8.8 and my server gateway, there's no problem. If I ping google.com, yahoo.com, etc, it returns "ping: unknown host google.com".

When I saw this problem, first thing I go to check is the /etc/resolv.conf file, but this file seems no problem. Where else should I check?

nameserver 8.8.8.8
nameserver 8.8.4.4
share|improve this question
    
The second nameserver should probably be 4.4.4.4? –  Raffael Luthiger Dec 12 '11 at 13:21
    
Nop, 4.4.4.4 is not working anymore. –  Dr I Dec 12 '11 at 13:24
1  
@DrI: Good to know. It is a long time ago I had to use them the last time. –  Raffael Luthiger Dec 12 '11 at 16:31

3 Answers 3

Few things you can try

Look at

/etc/nsswitch.conf 

Look for hosts: and see if it has dns listed

Then try to query google.com from their nameservers.. maybe output dns requests are failing

nslookup google.com 8.8.8.8

If that fails.. then

telnet 8.8.8.8 53

If you get a connection refused.. your ISP might be blocking your dns requests and you have to use their resolvers.

share|improve this answer

Do you maybe have a firewall in between which is blocking DNS traffic? You can try to make a lookup with dig and see if it works or not:

dig @8.8.8.8 www.google.com

If this does not work then it is probably a device (firewall) in between which is blocking your DNS traffic.

share|improve this answer

It seems that you don't have internet access at all, don't you?

If this is the case, have a look at your routing table using command route.

If you don't see a line like this one:

default 8.8.8.4 0.0.0.0

you probably have a gateway problem, check your network settings.

share|improve this answer
    
He sais that he can ping 8.8.8.8 so he has internet access for sure. –  Raffael Luthiger Dec 12 '11 at 13:26
1  
My bad, I didn't noticed that this ip was public google dns. I thought this was the ip for his router. They have a troubleshooting page here, maybe it will help. link –  Yann Sagon Dec 12 '11 at 13:50

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.