1

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
3
  • The second nameserver should probably be 4.4.4.4? Dec 12, 2011 at 13:21
  • Nop, 4.4.4.4 is not working anymore.
    – Dr I
    Dec 12, 2011 at 13:24
  • 1
    @DrI: Good to know. It is a long time ago I had to use them the last time. Dec 12, 2011 at 16:31

3 Answers 3

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.

2

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.

-1

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.

2
  • He sais that he can ping 8.8.8.8 so he has internet access for sure. Dec 12, 2011 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, 2011 at 13:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .