Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
host and nslookup ignoring entries in /etc/hosts
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
fbn
n00b
n00b


Joined: 12 Jun 2004
Posts: 10
Location: Europe / Germany

PostPosted: Fri Sep 10, 2004 5:43 pm    Post subject: host and nslookup ignoring entries in /etc/hosts Reply with quote

hi,

if i put some entries on /etc/hosts they will be ignored by host and nslookup:

Code:

dettnb80 deniedfr # cat /etc/hosts
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8 2003/08/04 20:12:25 azarah Exp $
#
127.0.0.1       dettnb80        localhost
192.168.1.224   bender

dettnb80 deniedfr # host bender
Host bender not found: 3(NXDOMAIN)
dettnb80 deniedfr # nslookup bender
Server:         194.25.2.129
Address:        194.25.2.129#53

** server can't find bender: NXDOMAIN


the server 194.25.2.129 is the dns server from my isp, he doesn't know the host bender.

my nsswitch.conf:
hosts: files dns
networks: files dns

eth0 (cable) and eth1 (wireless) are configured by dhcp.

what do i have to check to get name resolving working for entries in /etc/hosts?

regards,
frank
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Fri Sep 10, 2004 5:56 pm    Post subject: Reply with quote

It's my understanding that both host and nslookup do DNS lookups. They ignore /etc/hosts because they really aren't built to use it. On the other hand the resolv process within Linux itself should check /etc/hosts first if it's been configured that way.

You should be able to test by pinging bender which will work while nslookup continues to see nothing in DNS.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
fbn
n00b
n00b


Joined: 12 Jun 2004
Posts: 10
Location: Europe / Germany

PostPosted: Sat Sep 11, 2004 6:24 am    Post subject: Reply with quote

hi,

that's true i can ping bender and the ip gets resolved! thanks :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum