Path: utzoo!utgpu!news-server.csri.toronto.edu!math.lsa.umich.edu!zaphod.mps.ohio-state.edu!think.com!yale!ox.com!emv From: dwells@fits.cx.nrao.edu (Don Wells) Newsgroups: comp.archives Subject: [comp.protocols.tcp-ip.domains] Re: How to create /etc/hosts from zone Message-ID: <1990Nov17.061856.25568@ox.com> Date: 17 Nov 90 06:18:56 GMT References: <652@janus.Quotron.com> <19523@oolong.la.locus.com> Sender: emv@ox.com (Edward Vielmetti) Reply-To: dwells@fits.cx.nrao.edu (Don Wells) Followup-To: comp.protocols.tcp-ip.domains Organization: National Radio Astronomy Observatory, Charlottesville, VA Lines: 36 Approved: emv@ox.com (Edward Vielmetti) X-Original-Newsgroups: comp.protocols.tcp-ip.domains Archive-name: gethosts/15-Nov-90 Original-posting-by: dwells@fits.cx.nrao.edu (Don Wells) Original-subject: Re: How to create /etc/hosts from zone Archive-site: fits.cx.nrao.edu [192.33.115.8] Archive-directory: /pub/src Reposted-by: emv@ox.com (Edward Vielmetti) In article <1667@devildog.att.com> jrallen@devildog.att.com (Jon Allen) writes: References: <652@janus.Quotron.com> <19523@oolong.la.locus.com> It would be a work saver if I could just update the DNS files and generate an appropriate /etc/hosts for the dumb machines. I have constructed a tool that I call "gethosts" that can generate a hosts file from queries to the DNS for a domain. It has a variety of options, such as recursively descending a tree of subdomain servers, or appending the HINFO data to the lines in the hosts table, or inserting comments derived from "whois" queries to the NIC regarding the domain, and it even dumps inverse-address domains. Much of this capability makes gethosts useful for producing nicely formatted dumps of zones or trees of zones when one is exploring the Internet. The code is a big (20_KB) Bourne shell script which contains an awk program which invokes nslookup in subprocesses and analyzes the output. I run it with GNU awk (gawk). It is not fast (I often do "gethosts domain.edu >hosts.domain.edu &" to run it in the background), and it has some bugs, but I frequently find it useful. You can get the code via anonFTP: fits.cx.nrao.edu:/pub/src/gethosts.tar.Z [14.8_KB] [192.33.115.8] -- Donald C. Wells, Assoc. Scientist | dwells@nrao.edu Nat. Radio Astronomy Observatory | 6654::DWELLS Edgemont Road | +1-804-296-0277 38:02.2N Charlottesville, VA 22903-2475 USA | +1-804-296-0278(Fax) 78:31.1W