Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!ucsd!brian From: brian@ucsd.Edu (Brian Kantor) Newsgroups: comp.protocols.tcp-ip Subject: Re: Wanted: /etc/hosts to DNS (rfc1035) format conversion program Message-ID: <31801@ucsd.Edu> Date: 12 Apr 91 15:35:35 GMT References: <7571.9104101607@csunb0.dcs.leeds.ac.uk> <1991Apr11.220839.17490@cheops.qld.tne.oz.au> <1991Apr12.043024.7320@comp.vuw.ac.nz> Organization: The Avant-Garde of the Now, Ltd. Lines: 16 1 each stupid awk script that handles 90% of our needs for conversion of hosts table to domain database format: /^#/ {print "; "$0;next} /^$/ {next} { split($2,hn,"."); printf("%s\tIN\tA\t%s\n", hn[1], $1); for(i=3; i< 9; i++) { if (!$i) break; split($i,nn,"."); if (hn[1] != nn[1]) printf("%s\tIN\tCNAME\t%s\n", nn[1], hn[1]); } }