Subject: nslookup and hosts on local net
To: None <netbsd-help@netbsd.org>
From: Mark E. Perkins <perkinsm@bway.net>
List: netbsd-help
Date: 03/28/2002 17:16:49
How do I get nslookup to return the IP address of hosts on my local net? 
This probably applies to gethostbyname(), as well. To be more specific:

* I'm using 192.168.x.y addresses

* None of my local hosts have FQDNs; they're all things like 'netbsd1' 
'printserver', etc.

/etc/hosts looks thusly:
192.168.1.1  netbsd1
192.168.1.2  printserver
   (and so on)

/etc/resolv.conf has the line:
lookup file bind
(though I understand from the man pages that this is ignored)

/etc/nsswitch.conf has the line:
hosts:          files dns

/etc/rc.conf has the line
domainname=""

Nevertheless, if I say 'nslookup printserver' I get a "Non-existent 
host/domain" error back from the name server at my ISP. (I almost never 
want to do this, but some programs use gethostbyname() for a local network 
host and ending up failing....)

Other particulars that may matter:

NetBSD-1.5/mac68k

Thanks,
Mark