I am too young not to be able to resolve myself...nslookup problem (no DNS available)

I don't have DNS, and would like to resolve EVERYTHING through local /etc/hosts file.

My first sunbox has the following configuration:

# hostname
mybox.home.com

My host file is as follows:
# cat /etc/hosts
#
# Internet host table
#
127.0.0.1 localhost
192.25.x.x mybox.home.com mybox loghost

ifconfig is correct, and ping works:
# ping mybox.home.com
mybox.home.com is alive

I don't have a resolve file:
# ls /etc/res*
/etc/res*: No such file or directory

my nsswitch.conf looks like the following (no DNS):
# cat /etc/nsswitch.conf
#
# /etc/nsswitch.files:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any naming service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.

passwd: files
group: files
hosts: files
ipnodes: files
networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
publickey: files
# At present there isn't a 'files' backend for netgroup; the system will
# figure it out pretty quickly, and won't use netgroups at all.
netgroup: files
automount: files
aliases: files
services: files
printers: user files
auth_attr: files
prof_attr: files
project: files

yet I can't even resolve the box itself?

# nslookup mybox.home.com
;; connection timed out; no servers could be reached

# host 192.25.x.x
;; connection timed out; no servers could be reached

# nslookup 192.25.x.x
;; connection timed out; no servers could be reached

what am I missing?
manny

I don't get it... You state you don't want or need DNS

So why are you using nslookup? That is to lookup names from DNS (which means you need a /etc/resolv.conf pointing to a nameserver).

I thought there was a way to configure the box to resolve hostnames and IPaddresses through /etc/hosts

Is this wrong?

Like it was mentioned before, nslookup attempts to contact a (DNS) nameserver, which is exactly what you don't want to do. Simply putting the appropriate entries in /etc/hosts will accomplish what you would like.
Try typing

ping mybox.home.com

I thought I could configure the box, so that nslookup and host commands would resolve through /etc/hosts only.
thanks for clearing this up...your guidance is appreciated.

I'll be a solaris admin yet :smiley:

No, the closest you can get tho that is:

getent hosts some_hostname

This is one of the reasons why nslookup is deprecated in Linux. It uses its own libraries, not the same ones practically everything else on the box uses! That is, nslookup *will* use DNS- no matter what, even if you don't have it on the machine. It's hardcoded.

This is different behavior than the host resolution of, say, the ping command. That's why your nslookup will not work but your ping will. So you'll need to stick to ping for your testing.
-Mike