Path: utzoo!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ucbvax!LANL.GOV!cpw%sneezy From: cpw%sneezy@LANL.GOV (C. Philip Wood) Newsgroups: comp.protocols.tcp-ip Subject: Re: Reconciling /etc/hosts, yp, and named? Message-ID: <8901131834.AA00439@sneezy.lanl.gov> Date: 13 Jan 89 18:34:41 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 26 When you find the answer let us all know. My feeling is that a gethostby{name,addr} routine should have a heirarchy of lookup which could be configurable. But the default would be something like: /etc/hosts could contain the following kinds of entries: hostname +hostname + Order would be important. Then gethostby{name,addr} would do the following: Unless directed by some environment variable or other policy mechanism: open /etc/hosts and attempt to resolve the name by searching sequentially through /etc/hosts if the name is found and has the prefix '+' goto the "YP domainname server for that host" if the name is not found and the standalone '+' is found then try the YP server. If all the above has failed then go for the Internet Domain nameserver pointed to by /etc/resolv.conf or whatever mechanism. If there is no pointer to an Internet Domain nameserver then I guess you are done!