Re: Convert /etc/hosts to RR format pgm anyone?


der Mouse (mcgill-vision!mouse@bloom-beacon.mit.edu)
6 Jun 88 09:37:43 GMT


In article <21877@amdcad.AMD.COM>, indra@amdcad.AMD.COM (Indra K. Singhal) writes:
> Has anyone put together a program/shell script that converts
> /etc/hosts to the standard RR format as specified in the RFCs listed?

You probably don't want to do this as simply as you think. Why?

- /etc/hosts generally doesn't have domain-style addresses in it
- You'll need in-addr.arpa records too
- You probably want to put each domain into a file of its own, with SOA
   and NS records and suchlike....

If you really do want to just convert /etc/hosts to a bunch of A
records, it's hardly complicated....

< /etc/hosts sed -e 's/#.*//' \
| awk '{ for (i=2;i<=NF;i++) printf("%s\tin\ta\t%s\n",$i,$1); }' \
> wherever-you-want-the-RRs

(The resulting RRs should be loaded with a $ORIGIN of ., of course.)

                                        der Mouse

                        uucp: uucp: mouse@mcgill-vision.uucp
                        arpa: mouse@larry.mcrcim.mcgill.edu



This archive was generated by hypermail 2.0b3 on Thu Mar 09 2000 - 14:42:30 GMT