View previous topic :: View next topic |
Author |
Message |
fbn n00b
Joined: 12 Jun 2004 Posts: 10 Location: Europe / Germany
|
Posted: Fri Sep 10, 2004 5:43 pm Post subject: host and nslookup ignoring entries in /etc/hosts |
|
|
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 |
|
|
kashani Advocate
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Fri Sep 10, 2004 5:56 pm Post subject: |
|
|
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 |
|
|
fbn n00b
Joined: 12 Jun 2004 Posts: 10 Location: Europe / Germany
|
Posted: Sat Sep 11, 2004 6:24 am Post subject: |
|
|
hi,
that's true i can ping bender and the ip gets resolved! thanks |
|
Back to top |
|
|
|