🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #10642

Re: gethostbyname and nameserver resolution

#10642
From: Bob Cunningham
Date: Tue, 31 Jan 1989 21:06
39 lines
2428 bytes
>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 ]]
Technical Details
Message-ID: <8901241727.AA09415@kahala.hig.hawaii.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request
From: bob@kahala.hig.hawaii.edu (Bob Cunningham)
Newsgroups: comp.sys.sun
Subject: Re: gethostbyname and nameserver resolution
Message-ID: <8901241727.AA09415@kahala.hig.hawaii.edu>
Date: 31 Jan 89 21:06:03 GMT
Sender: usenet@rice.edu
Organization: Sun-Spots
Lines: 39
Approved: Sun-Spots@rice.edu
Original-Date: Tue, 24 Jan 89 07:27:05 HST
X-Sun-Spots-Digest: Volume 7, Issue 130, message 11 of 17