LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ping www.google.co.in gives unknown host error ,ping to LAN address works fine (https://www.linuxquestions.org/questions/linux-newbie-8/ping-www-google-co-in-gives-unknown-host-error-ping-to-lan-address-works-fine-880579/)

aspiring_stellar 05-13-2011 01:47 PM

ping www.google.co.in gives unknown host error ,ping to LAN address works fine
 
even ping google's ip address doesn't work. unknown host error
using backtrack4
able to browse net with these settings.

my network settings:

/etc/networking/interfaces
--------------------------
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 10.0.0.54
netmask 255.255.252.0
network 10.0.0.0
broadcast 10.0.3.255
gateway 10.0.0.254
--------------------------
/etc/resolv.conf

nameserver 202.141.81.2
nameserver 202.141.80.9

(note ping to DNS 202.141.81.2 works fine)
-----------------
/etc/nsswitch.conf

passwd: compat
group: compat
shadow: compat
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
------------------------
/etc/hosts

127.0.0.1 localhost
127.0.1.1 backtrack bt
--------------------------
/etc/host.conf

order hosts,bind
multi on
---------------------
please explain what's the problem with these settings...

acid_kewpie 05-13-2011 01:54 PM

OK, so your first comment is wonky...
Quote:

even ping google's ip address doesn't work. unknown host error
You'll *only* get that error from a failed DNS lookup, NOT by pinging an IP. So it seems there's some sort of DNS issue, step away from the ping, and concentrate on DNS only. what does "dig google.com" do? What about "dig google.com @202.141.81.2"? and the other DNS server IP?

szboardstretcher 05-13-2011 02:02 PM

pinging an IP address will not get you a "host unknown" error that I know of.

you can use 'dig' or 'nslookup' to test your DNS configuration.

if you can ping 8.8.8.8 (google dns)
and not www.google.com

then you are having DNS problems.

If you are able to ping internal addresses, and not external addresses, it might also be your default route. use 'route' to verify.

aspiring_stellar 05-13-2011 03:31 PM

@acid_kewpie: ok... my bad. actually i am not able to ping external addresses.
output of dig www.google.com@202.141.81.2
; <<>> DiG 9.5.0-P2.1 <<>> www.google.com@202.141.81.2
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 34420
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.google.com\@202.141.81.2. IN A

;; Query time: 9 msec
;; SERVER: 202.141.81.2#53(202.141.81.2)
;; WHEN: Thu May 12 16:43:43 2011
;; MSG SIZE rcvd: 45

@szboardstretcher: not able to ping 8.8.8.8 either
nslookup gives
;; Got SERVFAIL reply from 202.141.81.2, trying next server
;; connection timed out; no servers could be reached

route gives

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 * 255.255.252.0 U 0 0 0 eth0
default 10.0.0.254 0.0.0.0 UG 100 0 0 eth0

acid_kewpie 05-13-2011 04:37 PM

You typed the dig command wrong. There is a space before the @.

aspiring_stellar 05-14-2011 05:15 AM

ok.. output of "dig www.google.com @202.141.81.2"

; <<>> DiG 9.5.0-P2.1 <<>> www.google.com @202.141.81.2
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 26157
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

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

;; Query time: 11 msec
;; SERVER: 202.141.81.2#53(202.141.81.2)
;; WHEN: Fri May 13 03:40:38 2011
;; MSG SIZE rcvd: 32

seems space before '@' doesn't matter since output is same except line ";www.google.com\@202.141.81.2. IN A"

acid_kewpie 05-14-2011 06:44 AM

of course it matters, it makes the command work differently. If you don't understand what the command is even doing I'd suggest you don't question it.

Your DNS can't resolve google.com, so fix your DNS server.

aspiring_stellar 05-14-2011 07:44 AM

Thanks for all the replies.
I am still not able to sort out the DNS problem. what should be done ?

acid_kewpie 05-14-2011 07:48 AM

you need to make the DNS server resolve the name, or use a different DNS server. What other solution are you expecting??

aspiring_stellar 05-24-2011 03:21 PM

I think iptables blocks my ping requests. As this DNS server is not setup on my machine I can't exactly pin point the problem .But Yes I have tested it on my own LAN setup with one machine as dns and other as client and got the same error when tried to resolve domain name from client machine.Trying to figure out the problem, I found iptables was blocking my requests from other machines.After fixing it, now everything works fine.

Thanks acid_kewpie for all the responses and help.

vikas027 05-24-2011 03:26 PM

Quote:

Originally Posted by aspiring_stellar (Post 4365969)
Trying to figure out the problem, I found iptables was blocking my requests from other machines.After fixing it, now everything works fine.

Nice to hear that. Please mark this thread as SOLVED (follow my signature).


All times are GMT -5. The time now is 07:48 PM.