h2n 2.38

Andris Kalnozols andris at hpl.hp.com
Wed Jun 13 05:35:46 UTC 2001


> Rick Veenstra wrote:
>
> Another question about h2n.
> Previously we used hosts_to_named, a HP-provided shell script, to convert
> hosts files to bind 4.x db and config files. We are using a (generated)
> hosts file containing only fully qualified domain names from several
> domains. With hosts_to_named it was possible to generate data for several
> domains in one run, with a resulting named.boot containing references to
> all these domains. With h2n I have not (yet) managed to do this, since it
> only accepts one domain name with the -d option.

Enhancing h2n to be able to build multiple forward-mapping zones
at a time is something that a lot of users would like to see.
I'm taking a look at the time/space trade-offs that are involved
in changing the data structures to make this feature possible.

> Creating these files in more than one run results in an incomplete
> named.conf; it appears that h2n removes all references to zones that
> are not specified.  Is this correct or am I missing something?

Correct.  One way to reassemble the pieces would be to use a
different '+c' option for every run of h2n, e.g.,

  '+c named.conf'
  '+c named.conf.1'
  '+c named.conf.2'
  etc.

Afterwards, append the relevant zone declarations in files 1-N
to the main file like so:

  #!/usr/bin/ksh
  #
  for zones in named.conf.+([0-9])
  do
      # Remove the common initial lines containing the 'options'
      # statement plus the hint and loopback 'zone' statements.
      #
      sed -e '1,/db.127.0.0/d' $zones >> named.conf
  done

Hope this helps.

Andris Kalnozols
Hewlett-Packard Laboratories
andris at hpl.hp.com



More information about the bind-users mailing list