LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   DNS seems to work but can't ping out (http://www.linuxquestions.org/questions/linux-networking-3/dns-seems-to-work-but-cant-ping-out-775167/)

pjz 12-12-2009 10:51 AM

DNS seems to work but can't ping out
 
Hi-

Weird problem. Looked through the similar posts, found one like it, but it was suggested that firewall is the problem. Tried turning off firewall, didn't fix problem.

Here it is...

Had DNS set up working fine. Firefox got onto the web A-0K. Took a power glitch, reset the system. Now Firefox can't find anything unless I give it explicit IP addresses.

So, suspecting DNS (and using Google as an example site), I type:

host google.com

and get...

google.com has address 74.125.95.106
google.com has address 74.125.95.147
google.com has address 74.125.95.99
google.com has address 74.125.95.103
google.com has address 74.125.95.104
google.com has address 74.125.95.105
google.com mail is handled by 10 google.com.s9a2.psmtp.com.
google.com mail is handled by 10 google.com.s9b1.psmtp.com.
google.com mail is handled by 10 google.com.s9b2.psmtp.com.
google.com mail is handled by 10 google.com.s9a1.psmtp.com.

Then, I try (from the screwed up machine)...

ping google.com

And I get...

ping: unknown host google.com

...whereas if I try this on a different (un-screwed-up) computer, I get...

PING google.com (64.233.169.99) 56(84) bytes of data.
64 bytes from yo-in-f99.1e100.net (64.233.169.99): icmp_seq=1 ttl=243 time=31.9 ms
64 bytes from yo-in-f99.1e100.net (64.233.169.99): icmp_seq=2 ttl=243 time=32.6 ms
64 bytes from yo-in-f99.1e100.net (64.233.169.99): icmp_seq=3 ttl=243 time=39.5 ms

At this point, I'm thinking it's not a Firefox problem.

Back onto my screwed up machine. I can do a dig to google, and that seems to work out okay...

; <<>> DiG 9.6.1b1-RedHat-9.6.1-0.3.b1.fc11 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1247
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 4, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com. IN A

;; ANSWER SECTION:
google.com. 112 IN A 74.125.95.105
google.com. 112 IN A 74.125.95.106
google.com. 112 IN A 74.125.95.147
google.com. 112 IN A 74.125.95.99
google.com. 112 IN A 74.125.95.103
google.com. 112 IN A 74.125.95.104

;; AUTHORITY SECTION:
google.com. 172611 IN NS ns3.google.com.
google.com. 172611 IN NS ns1.google.com.
google.com. 172611 IN NS ns2.google.com.
google.com. 172611 IN NS ns4.google.com.

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Dec 12 10:48:36 2009
;; MSG SIZE rcvd: 196

...obviously, nslookup works great, too. When I do a /etc/init.d/named status, I get this...

version: 9.6.1b1-RedHat-9.6.1-0.3.b1.fc11
CPUs found: 1
worker threads: 1
number of zones: 15
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/0/1000
tcp clients: 0/100
server is up and running
named (pid 3495) is running...

... can't see anything in there to tip me off (maybe someone else can).

I'm wondering if one of the files that supports the DNS cache is fouled and that's what's screwing me up, but can't seem to find a really good explanation for DNS that doesn't take me a week to unravel. I'd be content to simply uninstall and re-install, but I'm not sure what to re-install.

Can anybody out there help? I'd rather not, but I may have to wipe my machine and re-install. Yuk! ...but, I'll do what I have to do.

Thanks in advance
pjz

bathory 12-12-2009 11:04 AM

It's not a bind problem, as you can resolve domains successfully.
Check /etc/nsswitch.conf and see if you have dns in the hosts line:
Code:

hosts:    files dns
Regards

pjz 12-13-2009 09:21 PM

Bathory-

Thank you for your prompt reply.

I have checked my /etc/nsswitch.conf, and I do have the entry "hosts: files dns"

pjz

targettl 12-14-2009 01:18 AM

No idea, if dig works so should ping in theory.

bathory 12-14-2009 03:46 AM

@OP

What's in /etc/resol.conf?

pjz 12-14-2009 11:01 AM

Bathory-

Fixed resolv.conf to match a working machine. Everything is back to normal. Many thanks - this saved me days.

pjz


All times are GMT -5. The time now is 01:25 PM.