LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-13-2011, 02:47 PM   #1
aspiring_stellar
LQ Newbie
 
Registered: May 2011
Distribution: Fedora, ubuntu
Posts: 18

Rep: Reputation: Disabled
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...
 
Old 05-13-2011, 02:54 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
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?
 
Old 05-13-2011, 03:02 PM   #3
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,369
Blog Entries: 1

Rep: Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088
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.
 
Old 05-13-2011, 04:31 PM   #4
aspiring_stellar
LQ Newbie
 
Registered: May 2011
Distribution: Fedora, ubuntu
Posts: 18

Original Poster
Rep: Reputation: Disabled
@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
 
Old 05-13-2011, 05:37 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
You typed the dig command wrong. There is a space before the @.
 
Old 05-14-2011, 06:15 AM   #6
aspiring_stellar
LQ Newbie
 
Registered: May 2011
Distribution: Fedora, ubuntu
Posts: 18

Original Poster
Rep: Reputation: Disabled
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"
 
Old 05-14-2011, 07:44 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
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.
 
Old 05-14-2011, 08:44 AM   #8
aspiring_stellar
LQ Newbie
 
Registered: May 2011
Distribution: Fedora, ubuntu
Posts: 18

Original Poster
Rep: Reputation: Disabled
Thanks for all the replies.
I am still not able to sort out the DNS problem. what should be done ?
 
Old 05-14-2011, 08:48 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
you need to make the DNS server resolve the name, or use a different DNS server. What other solution are you expecting??
 
Old 05-24-2011, 04:21 PM   #10
aspiring_stellar
LQ Newbie
 
Registered: May 2011
Distribution: Fedora, ubuntu
Posts: 18

Original Poster
Rep: Reputation: Disabled
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.
 
Old 05-24-2011, 04:26 PM   #11
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,267

Rep: Reputation: 99
Thumbs up

Quote:
Originally Posted by aspiring_stellar View Post
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).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ping: unknown host www.google.com tcma Linux - Networking 7 03-03-2012 12:47 AM
ping: unknown host www.google.com (wireless problem) J_Szucs Linux - Software 2 11-18-2009 04:44 PM
ping www.google.ca fine, www.google.com NOT!!!! DropSig Linux - Networking 1 01-19-2009 11:29 PM
FC6 ping on terminal works with www.google.com, not with http://www.google.com pxumsgdxpcvjm Linux - Networking 4 12-27-2006 04:36 PM
ping: unknown host www.google.com juanjavier_xxx Debian 8 01-02-2006 02:47 PM


All times are GMT -5. The time now is 09:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration