Getting SunOS 4.1 to use DNS -and- /etc/hosts (long)

Thomas Kaiser a2824ak at sunmanager.lrz-muenchen.de
Wed Mar 13 04:44:16 AEST 1991


>I retrieved bindon41.shar, hoping it would eventually produce a smarter
>resolver.  It includes instructions for FTPing the BIND source from
>ucbarpa.berkeley.edu and applying a few (included) patches.  When I followed
>the instructions, I got a working version of DNS, but it still ignored the
>/etc/hosts file!  However, I had the source, so all was not lost.

>The routine used by the network programs (telnet, ftp, etc.) to translate from
>a host name to a host address is gethostbyname().  I found this entry in the
>BIND source file gethostnamadr.c.  At then end of gethostbyname(), it does
>check the /etc/hosts file if connection to the name server was refused.  I
>broadened this behavior to check /etc/host if the name wasn't resolved for any
>reason.  Here's the diff output for my modification.

I also modified the original bind4.8.2 resolver routines. In mine i use
first /etc/hosts and then the resolver. I've done for both gethostbyname
and gethostbyaddr.

The problem with the other way round, is that the resolver routines have
to wait for timeout, if there is no information or nameserver. You
can also put shortnames in your /etc/hosts-file

Thomas Kaiser
Leibniz Computing Centre Munich
smtp =kaiser at sunmanager.lrz-muenchen.de
X.400=kaiser at lrz.lrz-muenchen.dbp.de
--
-------------------------------------------------------------------------
Thomas Kaiser         Internet:	kaiser at sunmanager.lrz-muenchen.de
LRZ-Muenchen          X400:	C=DE;A=DBP;P=LRZ-MUENCHEN;OU=LRZ;S=Kaiser
-------------------------------------------------------------------------



More information about the Comp.unix.admin mailing list