gethostbyname and nameserver resolution

Bob Cunningham bob at kahala.hig.hawaii.edu
Wed Feb 1 07:06:03 AEST 1989


>Routines like ftp rlogin telnet ... do not normally have access to
>nameserver resolution because neither yellow pages routines, nor
>gethostbyname calls the resolver routines.

The yellow pages routines will iff you use the -b flag on makedbm for the
hosts.byname and hosts.byaddr (for inverse lookups).  This is documented
(albeit somewhat obscurely) in the manual page for makedbm in SunOS4.0).
This means modifying /var/spool/Makefile roughly as follows (your line
numbers will vary):

65c65
<                   | $(MAKEDBM) -b - $(YPDBDIR)/$(DOM)/hosts.byname; \
---
>                   | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/hosts.byname; \
68c68
<                   | $(MAKEDBM) -b - $(YPDBDIR)/$(DOM)/hosts.byaddr; \
---
>                   | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/hosts.byaddr; \

This effectively forces ypserv to resolve through the nameserver.

There are still some problems with this (ypserv lookups may not properly
time out, hosts with single-character names are not treated right, etc.),
up through SunOS4.0.1.  Previous versions also had other problems as well
(the special yp map entry created by that flag didn't propagate to slave
servers, etc.).  I highly recommend you actually use the ypserv and other
routines in the  ~ftp/sun-fixes/ddn.tar.Z kit available via anonymous ftp
from uunet.uu.net which has the latest versions of all the pieces you'll
need, including pieces that will work with SunOS releases going back to
SunOS3.5.

Also available in ~ftp/sun-fixes are sharable libc_resolv.so files,
updated versions of ypbind and in.ftpd and other items, all kindly
contributed in the public interest by the network development folks at Sun
and (I hope) all to be included in SunOS4.0.2.

[[ As I understand it, this does not work very well at all under 4.0, it
works in most cases under 4.0.1, and should work quite well under 4.0.2.
See v7n122.  --wnl ]]



More information about the Comp.sys.sun mailing list