-   Linux - Networking (
-   -   DNS seems to work but can't ping out (

pjz 12-12-2009 10:51 AM

DNS seems to work but can't ping out

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:


and get... has address has address has address has address has address has address mail is handled by 10 mail is handled by 10 mail is handled by 10 mail is handled by 10

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


And I get...

ping: unknown host

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

PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=243 time=31.9 ms
64 bytes from ( icmp_seq=2 ttl=243 time=32.6 ms
64 bytes from ( 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 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1247
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 4, ADDITIONAL: 0

; IN A

;; ANSWER SECTION: 112 IN A 112 IN A 112 IN A 112 IN A 112 IN A 112 IN A

;; AUTHORITY SECTION: 172611 IN NS 172611 IN NS 172611 IN NS 172611 IN NS

;; Query time: 1 msec
;; 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

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:

hosts:    files dns

pjz 12-13-2009 09:21 PM


Thank you for your prompt reply.

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


targettl 12-14-2009 01:18 AM

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

bathory 12-14-2009 03:46 AM


What's in /etc/resol.conf?

pjz 12-14-2009 11:01 AM


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


All times are GMT -5. The time now is 12:15 PM.