[comp.protocols.tcp-ip] YP, /etc/hosts, domains

mrc@SUMEX-AIM.STANFORD.EDU (Mark Crispin) (01/16/89)

     My workstation is a NeXT that seems to have more or less vanilla SUN type
networking software.

     I was forced to turn on YP in order to get any form of domain lookups to
work at all.  I set up an /etc/resolv.conf file and rebooted, but still no
host lookups would work unless the entry was in /etc/hosts.

     Since that time, I've been continuously forced to ask the owner of the YP
server just to get the most trivial things done, like getting new services
added to the list for (development) software only I use.  My workstation's
/etc/services file is completely ignored.  I've not lunk my password file into
the YP namespace, and I have no interest in any of the "features" of YP.

     In other words, I'd dearly love to turn YP off, if only I could get
ordinary domain lookups working.  How do I do this?  Do I have to run a domain
server too, just to get the resolver working?

     Also, while I have everybody's attention, how do I load private
information into my machine's resolver's cache?  I want to put in certain RR's
that only my machine should know.  They're totally outside of the domain my
machine lives in.  I just want the cache at startup to have these RR's (with
more or less infinite timeouts) as if they came from the outside.  In the
TOPS-20 world, this was done by a "CLOAD <file>" in DOMAIN:RESOLV.CONFIG.

     Yet another thing; how do I persuade Unix to use uppercase or mixed case
for hostnames?  My machine's hostname is set to "Tomobiki-Cho" (and is
reported as such by hostname), but gethostbyname("Tomobiki-Cho") insists upon
returning an all lowercase string.  It even does this for hostnames in the
outside world whose domain servers are known to return uppercase strings in
the RR's!

-------

rminnich@super.ORG (Ronald G Minnich) (01/18/89)

In article <MS-C.600902311.377401575.mrc@SUMEX-AIM.Stanford.EDU> mrc@SUMEX-AIM.STANFORD.EDU (Mark Crispin) writes:
>     In other words, I'd dearly love to turn YP off, if only I could get
>ordinary domain lookups working.  How do I do this?  Do I have to run a domain
>server too, just to get the resolver working?
well, i had this problem too. I have two possible solutions:
1) You got yp source? Then build a hot-wired ypbind/ypserv pair that only
   look at your machines IP address. Bingo, you have your own private servers,
   but the domain name is still the same as your networks (important for 
   lots of things). This works well here. 
2) No yp source? Set up your own yp domain, like crispin.org or something,
   but this is messier; you have to set domainname and all that and make
   sendmail work right. I don't like this approach too much. 
3) Fix up /etc/rc so that it does a ypset to your host, and have your
   own maps built for only your host, and get rid of all but the host.*
   maps. This gets messy too, and you have to keep making sure that 
   (1) only you and no one else binds to your host
   (2) you STAY bound to your host (ypbind will move you around as it 
       sees fit)

after messing with (1), (2), and (3), i stuck with (1). Note that there 
are several funny bugs in some ypservs (Ultrix comes to mind) so you have
to check out the source of your source. 
Specific example: yp uses dbm, not ndbm, but ypserv calls dbm_close when 
it switches maps (with a char * yet!!)(should be DBM *;found in xinu & ultrix)
Newest sun source shows it calling dbmclose, but still with a char * argument.
(dbmclose takes no arguments)
   If you want c-diffs for what i had to do here let me know. I am 
pretty sure Stanford has a source license, right :-)?
ron
rminnich@super.org
P.S. yp to me always seems to have been a good first cut, but i think
     it is time for another go at the whole problem. hesiod, anyone?