bowei_99 has asked for the wisdom of the Perl Monks concerning the following question:

All, Does anyone know of a good script to convert host files to DNS zone files? I tried using h2n, with an updated version here. I figured since the former was written by the author of DNS and Bind (Cricket Liu), and the latter is another coworker at HP according to Liu in his companion DNS book. However, after looking at the code, I find that it's very much spaghetti with long, long subroutines (not modules), tons of global variables... the usual stuff one should try to avoid. Granted, it seems even the latter was last updated in 2004, so refactoring may not be a priority for them now.

However, as I'm slated to get this DNS migration done in a couple weeks, I'm wondering if people know of something better to convert hosts files to DNS zone files. Suggestions, anyone?

-- Burvil

  • Comment on Script to convert hosts file to DNS zone files?

Replies are listed 'Best First'.
Re: Script to convert hosts file to DNS zone files?
by superfrink (Curate) on Oct 10, 2007 at 23:53 UTC
    As much as one can appreciate easy to read code if you need to run the script for a one time migration and it works then what is wrong with using it?

    Regarding your question I don't have a script that does it but you can check out the zone file modules on CPAN.
      It's not that I mind writing a script. The issue is a) I don't really have time and b) even if I did, I'd rather go with something that's been field tested. Although a lot of the CPAN modules are field tested, I'd still be writing code on my own, in effect, possibly reinventing the wheel.

      -- Burvil