[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: hosts, resolv setup?



Quoting Svante Signell <svante.signell@telia.com> [010217 07:50]:
> Can someone explain to me how to set up /etc/hosts and
> /etc/resolv.conf for ssh (and similar programs) _not_ to search for my
> local network host names using the external nameservers in
> resolv.conf? 

as in, "do not connect to Internet when I only operate on my LAN"?

> /etc/hosts:
> 127.0.0.1 localhost
> 192.160.0.1 host1.my.own.domain host1
> 192.160.0.2 host2.my.own.domain host2
> etc ...
> 
> /etc/resolv.conf:
> search my.own.domain
> nameserver xxx.yyy.zzz.www # External name server 1
> ...

looks fine. But, for example, does 'ping host1' try to contact x.y.z.w
to resolv host1? Or does this only occur with ssh?
Then it might be that sshd wants to reverse lookup the IP, which
causes an external lookup.

> Anything else to set up?

/etc/host.conf:
order hosts,bind

specifies that it should look at the hosts file first, and then use
bind.

You also might want to check what actually is asked for from the
nameserver, by using 'tcpdump -n udp and port 53', or use ethereal instead,
which does a nicer job of decoding (be sure to disable host lookups
though :)

> Thanks,
> Svante

-- 
Stefan



Reply to: