DNS: ping gives "unknown host", but nslookup works

DNS: ping gives "unknown host", but nslookup works

Post by terje_na.. » Sun, 31 Dec 1899 09:00:00



Hello.

I have a configuration problem.

Whenever I try to ping, ftp, telnet, etc. to any host, I get
an "unknown host" error.  But, when I do an nslookup on that host, it
returns the IP address quickly and with no problems at all.

I'm running redHat Linux 6.1. No local nameserver (I'm using my IPS's).

resolve.conf should be configured correct (nslookup works)
host.conf is:
order hosts, bind
multi on

In another NG, somebody had the same problem, and it was suggested that
nsswitch.conf was the problem (dns was to be given higher priority in
the hosts line). I tried that but i did not solve anything for me (NIS
is not installed anyway).

Any suggestions?

TIA Terje

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

DNS: ping gives "unknown host", but nslookup works

Post by Craig Kelle » Sun, 31 Dec 1899 09:00:00



> Hello.

> I have a configuration problem.

> Whenever I try to ping, ftp, telnet, etc. to any host, I get
> an "unknown host" error.  But, when I do an nslookup on that host, it
> returns the IP address quickly and with no problems at all.

> I'm running redHat Linux 6.1. No local nameserver (I'm using my IPS's).

> resolve.conf should be configured correct (nslookup works)
> host.conf is:
> order hosts, bind
> multi on

> In another NG, somebody had the same problem, and it was suggested that
> nsswitch.conf was the problem (dns was to be given higher priority in
> the hosts line). I tried that but i did not solve anything for me (NIS
> is not installed anyway).

> Any suggestions?

Does `route` show your default route correctly?

--
The wheel is turning but the hamster is dead.



 
 
 

DNS: ping gives "unknown host", but nslookup works

Post by Villy Kru » Sun, 31 Dec 1899 09:00:00


On Tue, 20 Jun 2000 09:09:24 GMT,

Quote:>Hello.

>I have a configuration problem.

>Whenever I try to ping, ftp, telnet, etc. to any host, I get
>an "unknown host" error.  But, when I do an nslookup on that host, it
>returns the IP address quickly and with no problems at all.

>I'm running redHat Linux 6.1. No local nameserver (I'm using my IPS's).

>resolve.conf should be configured correct (nslookup works)
>host.conf is:
>order hosts, bind
>multi on

resolve.conf has very litle if any say when it comes to specifying
the order of looking up host names on glibc2 based systems.
/etc/nsswitch.conf is the authority here, especialy the line:

hosts:      files dns

Redhat has been a glibc2 based system fo quite a few releases now,
including releases 5.x and 6.x.

Villy

 
 
 

DNS: ping gives "unknown host", but nslookup works

Post by terje_na.. » Sun, 31 Dec 1899 09:00:00





> > Hello.

> > I have a configuration problem.

> > Whenever I try to ping, ftp, telnet, etc. to any host, I get
> > an "unknown host" error.  But, when I do an nslookup on that host,
it
> > returns the IP address quickly and with no problems at all.

> > I'm running redHat Linux 6.1. No local nameserver (I'm using my
IPS's).

> > resolve.conf should be configured correct (nslookup works)
> > host.conf is:
> > order hosts, bind
> > multi on

> > In another NG, somebody had the same problem, and it was suggested
that
> > nsswitch.conf was the problem (dns was to be given higher priority
in
> > the hosts line). I tried that but i did not solve anything for me
(NIS
> > is not installed anyway).

> > Any suggestions?

> Does `route` show your default route correctly?

As far as I know it should be correct. I can telnet to the mashine and
the webserver workes fine, but the mashine itself can't do dns-lookups.

As you can se it's behind a firewall. Could that have anything to do
with it. And how can I test to see if it has.

/sbin/route -n
Kernel IP routing table
Destination   Gateway      Genmask         Flags Metric Ref  Use Iface
10.1.1.220    0.0.0.0      255.255.255.255 UH    0      0      0 eth0
192.168.3.12  0.0.0.0      255.255.255.255 UH    0      0      0 eth0
192.168.3.0   0.0.0.0      255.255.255.0   U     0      0      0 eth0
0.0.0.0       0.0.0.0      255.0.0.0       U     0      0      0 eth0
127.0.0.0     0.0.0.0      255.0.0.0       U     0      0      0 lo
0.0.0.0       192.168.3.1  0.0.0.0         UG    0      0      0 eth0

/Terje

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

DNS: ping gives "unknown host", but nslookup works

Post by terje_na.. » Sun, 31 Dec 1899 09:00:00




> On Tue, 20 Jun 2000 09:09:24 GMT,

> >Hello.

> >I have a configuration problem.

> >Whenever I try to ping, ftp, telnet, etc. to any host, I get
> >an "unknown host" error.  But, when I do an nslookup on that host, it
> >returns the IP address quickly and with no problems at all.

> >I'm running redHat Linux 6.1. No local nameserver (I'm using my
IPS's).

> >resolve.conf should be configured correct (nslookup works)
> >host.conf is:
> >order hosts, bind
> >multi on

> resolve.conf has very litle if any say when it comes to specifying
> the order of looking up host names on glibc2 based systems.
> /etc/nsswitch.conf is the authority here, especialy the line:

> hosts:      files dns

> Redhat has been a glibc2 based system fo quite a few releases now,
> including releases 5.x and 6.x.

> Villy

My 'hosts:' line in /etc/nsswitch.conf look exactly like that, so
that's not the problem.

/Terje

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

DNS: ping gives "unknown host", but nslookup works

Post by Craig Kelle » Sun, 31 Dec 1899 09:00:00



> As far as I know it should be correct. I can telnet to the mashine and
> the webserver workes fine, but the mashine itself can't do dns-lookups.

> As you can se it's behind a firewall. Could that have anything to do
> with it. And how can I test to see if it has.

> /sbin/route -n
> Kernel IP routing table
> Destination   Gateway      Genmask         Flags Metric Ref  Use Iface
> 10.1.1.220    0.0.0.0      255.255.255.255 UH    0      0      0 eth0
> 192.168.3.12  0.0.0.0      255.255.255.255 UH    0      0      0 eth0
> 192.168.3.0   0.0.0.0      255.255.255.0   U     0      0      0 eth0
> 0.0.0.0       0.0.0.0      255.0.0.0       U     0      0      0 eth0
> 127.0.0.0     0.0.0.0      255.0.0.0       U     0      0      0 lo
> 0.0.0.0       192.168.3.1  0.0.0.0         UG    0      0      0 eth0

You don't have a default route in there (and all your IP addresses are
non-routable, but I assume you know that).

Here's a properly configured machine with only one IP address on a
class C network:

$ /sbin/route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref Use Iface
my.host.name    *               255.255.255.255 UH    0      0   0 eth0
134.50.8.0      *               255.255.255.0   U     0      0   0 eth0
127.0.0.0       *               255.0.0.0       U     0      0   0 lo
default         my.router.name  0.0.0.0         UG    0      0   0 eth0

Note the default route.  I'm still not sure exactly what you are
doing, but perhaps this will help you.

--
The wheel is turning but the hamster is dead.


 
 
 

DNS: ping gives "unknown host", but nslookup works

Post by terje_na.. » Sun, 31 Dec 1899 09:00:00





> > As far as I know it should be correct. I can telnet to the mashine
and
> > the webserver workes fine, but the mashine itself can't do dns-
lookups.

> > As you can se it's behind a firewall. Could that have anything to do
> > with it. And how can I test to see if it has.

> > /sbin/route -n
> > Kernel IP routing table
> > Destination   Gateway      Genmask         Flags Metric Ref  Use
Iface
> > 10.1.1.220    0.0.0.0      255.255.255.255 UH    0      0      0
eth0
> > 192.168.3.12  0.0.0.0      255.255.255.255 UH    0      0      0
eth0
> > 192.168.3.0   0.0.0.0      255.255.255.0   U     0      0      0
eth0
> > 0.0.0.0       0.0.0.0      255.0.0.0       U     0      0      0
eth0
> > 127.0.0.0     0.0.0.0      255.0.0.0       U     0      0      0 lo
> > 0.0.0.0       192.168.3.1  0.0.0.0         UG    0      0      0
eth0

> You don't have a default route in there (and all your IP addresses are
> non-routable, but I assume you know that).

Yes, I know. It gets masquarated by the firewall.

0.0.0.0 indicates my default route (the -n in /sbin/route -n) and it
should work. I can ping an IP-number fine, but I just can't look up a
host name.

- Show quoted text -

Quote:> Here's a properly configured machine with only one IP address on a
> class C network:

> $ /sbin/route
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref Use
Iface
> my.host.name    *               255.255.255.255 UH    0      0   0
eth0
> 134.50.8.0      *               255.255.255.0   U     0      0   0
eth0
> 127.0.0.0       *               255.0.0.0       U     0      0   0 lo
> default         my.router.name  0.0.0.0         UG    0      0   0
eth0

> Note the default route.  I'm still not sure exactly what you are
> doing, but perhaps this will help you.

I think my routing is OK, because everything works, except looking up a
hostnames IP-addr.

/Terje

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

DNS: ping gives "unknown host", but nslookup works

Post by Quiney, Philip [HAL02:HH00:EXCH » Sun, 31 Dec 1899 09:00:00






> > > As far as I know it should be correct. I can telnet to the mashine
> and
> > > the webserver workes fine, but the mashine itself can't do dns-
> lookups.

> > > As you can se it's behind a firewall. Could that have anything to do
> > > with it. And how can I test to see if it has.

> > > /sbin/route -n
> > > Kernel IP routing table
> > > Destination   Gateway      Genmask         Flags Metric Ref  Use
> Iface
> > > 10.1.1.220    0.0.0.0      255.255.255.255 UH    0      0      0
> eth0
> > > 192.168.3.12  0.0.0.0      255.255.255.255 UH    0      0      0
> eth0
> > > 192.168.3.0   0.0.0.0      255.255.255.0   U     0      0      0
> eth0
> > > 0.0.0.0       0.0.0.0      255.0.0.0       U     0      0      0
> eth0
> > > 127.0.0.0     0.0.0.0      255.0.0.0       U     0      0      0 lo
> > > 0.0.0.0       192.168.3.1  0.0.0.0         UG    0      0      0
> eth0

> > You don't have a default route in there (and all your IP addresses are
> > non-routable, but I assume you know that).

> Yes, I know. It gets masquarated by the firewall.

> 0.0.0.0 indicates my default route (the -n in /sbin/route -n) and it
> should work. I can ping an IP-number fine, but I just can't look up a
> host name.

Hi,

I think the fault is that you seem to have 2 'default' routes. IIRC the
packets are matched against the table until a match is found. You
have....

..snip...
0.0.0.0       0.0.0.0      255.0.0.0       U     0      0      0 eth0
127.0.0.0     0.0.0.0      255.0.0.0       U     0      0      0 lo
0.0.0.0       192.168.3.1  0.0.0.0         UG    0      0      0 eth0

The first default route has no gateway entry so it won't work. Also it
will break the loopback interface as well!

For comparison my routing table is....


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
47.101.117.46   0.0.0.0         255.255.255.255 UH    0      0        0
eth0
47.101.112.0    0.0.0.0         255.255.240.0   U     0      0        0
eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0
lo
0.0.0.0         47.101.112.1    0.0.0.0         UG    0      0        0
eth0    

or if you prefer names


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
phard1e0        *               255.255.255.255 UH    0      0        0
eth0
corwan          *               255.255.240.0   U     0      0        0
eth0
loopback        *               255.0.0.0       U     0      0        0
lo
default         tharrd1.europe. 0.0.0.0         UG    0      0        0
eth0    

In cases like these tcpdump is your friend

HTH

Regards

Phil Q

--

Phil Quiney                             CSIP Demonstrator

Telephone: +44 (1279) 402363            London Rd, Harlow,
Fax:       +44 (1279) 402885            Essex CM17 9NA,
                                        United Kingdom.

"This message may contain information proprietary to Northern
Telecom so any unauthorised disclosure, copying or distribution
of its contents is strictly prohibited."

 
 
 

DNS: ping gives "unknown host", but nslookup works

Post by terje_na.. » Sun, 31 Dec 1899 09:00:00








> > > > As far as I know it should be correct. I can telnet to the
mashine
> > and
> > > > the webserver workes fine, but the mashine itself can't do dns-
> > lookups.

> > > > As you can se it's behind a firewall. Could that have anything
to do
> > > > with it. And how can I test to see if it has.

> > > > /sbin/route -n
> > > > Kernel IP routing table
> > > > Destination   Gateway      Genmask         Flags Metric Ref  Use
> > Iface
> > > > 10.1.1.220    0.0.0.0      255.255.255.255 UH    0      0      0
> > eth0
> > > > 192.168.3.12  0.0.0.0      255.255.255.255 UH    0      0      0
> > eth0
> > > > 192.168.3.0   0.0.0.0      255.255.255.0   U     0      0      0
> > eth0
> > > > 0.0.0.0       0.0.0.0      255.0.0.0       U     0      0      0
> > eth0
> > > > 127.0.0.0     0.0.0.0      255.0.0.0       U     0      0
0 lo
> > > > 0.0.0.0       192.168.3.1  0.0.0.0         UG    0      0      0
> > eth0

> > > You don't have a default route in there (and all your IP
addresses are
> > > non-routable, but I assume you know that).

> > Yes, I know. It gets masquarated by the firewall.

> > 0.0.0.0 indicates my default route (the -n in /sbin/route -n) and it
> > should work. I can ping an IP-number fine, but I just can't look up
a
> > host name.

> Hi,

> I think the fault is that you seem to have 2 'default' routes. IIRC
the
> packets are matched against the table until a match is found. You
> have....

> ..snip...
> 0.0.0.0       0.0.0.0      255.0.0.0       U     0      0      0 eth0
> 127.0.0.0     0.0.0.0      255.0.0.0       U     0      0      0 lo
> 0.0.0.0       192.168.3.1  0.0.0.0         UG    0      0      0 eth0

Hello,

I must have mest my posting up, because it should have been 10.0.0.0,
and not 0.0.0.0. I do beleve that my routing is OK.

The wierd thing is that a dnsquery gives:

#dnsquery www.dr.dk
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60090
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 3
;;      www.dr.dk, type = ANY, class = IN
www.dr.dk.              7m35s IN A      129.142.20.35
www.dr.dk.              14m18s IN MX    10 www.dr.dk.
dr.DK.                  18h58m40s IN NS  ns2.uni2.net.
dr.DK.                  18h58m40s IN NS  ns.uni2.net.
www.dr.dk.              7m35s IN A      129.142.20.35
ns2.uni2.net.           1d16h34m34s IN A  195.82.195.99
ns.uni2.net.            1d21h4m17s IN A  129.142.7.99

right away. So why does my dns-tools work, when other tools (ping,
tilnet, ...) can't look up a hostname?

Best regards

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

DNS: ping gives "unknown host", but nslookup works

Post by s. keeli » Sun, 31 Dec 1899 09:00:00



> On Tue, 20 Jun 2000 09:09:24 GMT,

> >I have a configuration problem.

> >Whenever I try to ping, ftp, telnet, etc. to any host, I get
> >an "unknown host" error.  But, when I do an nslookup on that host, it
> >returns the IP address quickly and with no problems at all.

> >I'm running redHat Linux 6.1. No local nameserver (I'm using my IPS's).

> >resolve.conf should be configured correct (nslookup works)
> >host.conf is:
> >order hosts, bind
> >multi on

Hmm ...  My resolv.conf looks like this (edited slightly):

hostresorder local bind
search spots.ab.ca
nameserver 209.115.174.2
nameserver 209.115.174.3

Quote:> resolve.conf has very litle if any say when it comes to specifying
> the order of looking up host names on glibc2 based systems.
> /etc/nsswitch.conf is the authority here, especialy the line:

What?  I thought nsswitch.conf was for NIS.  Are you running NIS?

Quote:> Redhat has been a glibc2 based system fo quite a few releases now,

What does glibc have to do with name server services?

--


    Any technology distinguishable from magic is insufficiently advanced.

 
 
 

DNS: ping gives "unknown host", but nslookup works

Post by Stuart R. Full » Sun, 31 Dec 1899 09:00:00


:
: What?  I thought nsswitch.conf was for NIS.  Are you running NIS?

"ns" is "Name Services".  

: > Redhat has been a glibc2 based system fo quite a few releases now,
:
: What does glibc have to do with name server services?

Where do think the resolver is located?

        Stu

 
 
 

1. named: "found it", ping: "unknown host"

Dear All

Soory, this looks much like a standard Unix question:

Applications can't resolve some addresses of my domain and only from my
Linux PC: all those who starts with the same group of letters as the
Linux PC itself, i.e.: tvn_pc, tvn_xt, tvn_lap. The Linux box's name is
tvn_linux. I don't have such problem with my other Unix boes nor my
PC's.

1/ I've setup a local named to monitor the name resolution: it's Ok.
named finds it but the invoking application don't get it.
2/ My resolv.conf has a search onto my subdomain and main domain.
3/ My nsswitch.conf says  hosts: dns [NOTFOUND=continue] files

If I put an entry in the /etc/hosts: it works.

How can it be doing this?

Many thanks,
Thierry de Villeneuve

----


ping: unknown host tvn_pc

----

the /var/tpm/named.run (Intranet names and IPs edited) reports:

datagram from [192.4.209.73].1370, fd 22, len 35; now Fri Jun 12
09:46:44 1998
ns_req(from=[192.4.209.73].1370)
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59847
;; flags: rd; Ques: 1, Ans: 0, Auth: 0, Addit: 0
;; QUESTIONS:
;;      tvn_pc.rbc.st.com, type = A, class = IN

req: nlookup(tvn_pc.rbc.tt.com) id 59847 type=1 class=1
req: found 'tvn_pc.rbc.tt.com' as 'tvn_pc.rbc.tt.com' (cname=0)
wanted(0x8079988, 1, 1) [IN A]
make_rr(tvn_pc.rbc.tt.com, 8079988, bffffc1b, 465, 1) 4 zone 0 ttl
897753892
finddata: added 1 class 1 type 1 RRs
req: foundname=1, count=1, founddata=1, cname=0
sort_response(1)
findns: np 0x8078140 'tvn_pc'
match(0x8079988, 1, 2) 1, 1
findns: np 0x8079d10 'rbc'
match(0x8077f28, 1, 2) 1, 6
match(0x80780a0, 1, 2) 1, 2
findns: 1 NS's added for 'rbc'
make_rr(rbc.st.com, 80780a0, bffffc2b, 449, 1) 17 zone 0 ttl 897754724
free_nsp: rbdns.rbc.tt.com rcnt 1
doaddinfo() addcount = 1
do additional "rbdns.rbc.tt.com" (from "rbc.tt.com")
found it
match(0x8078fd0, 1, 5) 1, 1
match(0x8078fd0, 1, 5) 1, 1
match(0x8078fd0, 1, 1) 1, 1
make_rr(rbdns.rbc.st.com, 8078fd0, bffffc49, 419, 0) 4 zone 0 ttl
897754724
addinfo: adding address data n = 16
ns_req: answer -> [192.4.209.73].1370 fd=22 id=59847 size=97 Local

2. closing ports

3. nslookup works, ping <host> replies unknown host

4. Linux Tutorial: Fees Reduced and Tutorial Descriptions for

5. can't ping, ftp etc "Unable to connect, unknown host"

6. portfw log

7. pb: "unknown host" from ping.

8. locale setting

9. Local DNS... "unknown host"

10. "weof" operation in "mt" command gives "permission denied"

11. DNS: Unknown host error, but nslookup works fine

12. GETSERVBYNAME()????????????????????"""""""""""""

13. PLEASE HELP: PING, DNS AND NSLOOKUP - NSLOOKUP GOOD PING BAD