Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!spool.mu.edu!agate!ucbvax!MICKEY.YCC.YALE.EDU!Watt-Alan From: Watt-Alan@MICKEY.YCC.YALE.EDU Newsgroups: comp.protocols.tcp-ip.domains Subject: Re: Building /etc/hosts from DNS anyone? Message-ID: <9106052021.AA29681@mickey.ycc.yale.edu> Date: 5 Jun 91 20:21:24 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 47 Thomas Tornblom (t_tornblom@nexus.se) writes: >Has anyone built tools for creating /etc/hosts? > >I'm tired of having to manage two sets of files manually when running YP, or >am I missing something? > >I thought that the -b flag would solve the problem, getting away with the >yp map for hosts but it seems that yp requires the local hosts to be in >the maps. > >I've been fiddling with dig using zone transfer and piping through a >collection of awk scripts to create the hosts file and they are almost >working but if someone has done this already I'd be glad to know. > >Thomas >-- >Real life: Thomas Tornblom Email: t_tornblom@nexus.se >Snail mail: Communicator Nexus Phone: +46 18 171814 > Box 857 Fax: +46 18 696516 > S - 751 08 Uppsala, Sweden What we do instead is build both from a "local.txt" file, kept in the format specified by RFC 952. The original tool to do this was a big awk/sed/grep/shell script written by Morrow Long here. I've been working on a replacement written in perl. Although it is a few details short of generating correct DNS source files, this project has clearly demonstrated to me that perl is the right tool for this kind of job. From the RFC 952 format file, the standard Berkeley UNIX utility "htable" will generate both /etc/hosts and /etc/networks. This is the procedure used at Yale. The current LOCAL.TXT file is periodically retrieved from NIC.DDN.MIL, combined with the Yale-maintained LOCAL.TXT file, and passed through "htable" to get the standard /etc/hosts file. - Alan S. Watt High Speed Networking, Yale University Computing and Information Systems Box 2112 Yale Station New Haven, CT 06520-2112 (203) 432-6600 X394 Watt-Alan@Yale.Edu Disclaimer: "Make Love, Not War -- Be Prepared For Both" - Edelman's Sporting Goods [and Marital Aids?]