From: Greg Ercolano <erco@(email surpressed)>
Subject: [OSX/LINUX SYSADMIN] A script that converts /etc/hosts into a DNS
   Date: Sun, 07 May 2006 15:28:11 -0400
Msg# 1283
View Complete Thread (4 articles) | All Threads
Last Next
I wrote a little perl script that automatically converts an /etc/hosts file
into an internal DNS server configuration, typical of small business networks:

    http://seriss.com/people/erco/unixtools/hosts2dns/

The script is tested to work under OSX 10.3.9 and 10.4.x, and Fedora Core 3.

I use it on my own internal network just to make DNS management easy.
Thought I'd offer it publicly as a GPL'ed tool as well.

The way it works is you just add/remove hosts in your /etc/hosts file,
then run the script as 'hosts2dns -update' to update DNS with the entries
in the /etc/hosts file.

There are no other config files; it gets everything it needs from your
/etc/hosts file. Simple comment markers are used to help this script
determine eg. which hosts you want added to DNS, and what your domain name is.

Keep in mind this script completely takes over the named.conf and creates its
own zone files; it does not attempt to preserve a previous DNS server config.
So if you have a previous config, tar it off first. Or, try it out on a test
machine before installing it on an actual internal DNS server.

It's a version 0.90, so it's still in 'beta', but it should work fine.

Last Next