com.sagestudio.jh2n
Class jh2n_manual

java.lang.Object
  |
  +--com.sagestudio.jh2n.jh2n_manual

public class jh2n_manual
extends java.lang.Object

JH2N - A java host to name server converter.
A java replacement/enhancement of the perl program of the same name. It does operate in a slightly different manner then the original h2n, as this version was written to support the many virtual domains found at an ISP. The -d option is not meaningfull, as this h2n assumes that every domain found in the host file is to have SOA records built. This version takes many of the same arguments as the original h2n.

JH2N takes a classic hosts style file as input and generates a valid set of bind version 8 configuration and zone files. Various options specified below control the creation of these files.
JH2N makes some basic assumptions:
It will create zones for all domains and subdomains for wich records exist in the host file.

Typical processing is as follows:

  1. Read command line options.
  2. Read hosts file.
    Discard records that are outside of networks specified in the -n directive.
  3. Create cross referenced cname and address records for all domains and subdomains for which host records are found.
  4. Create named.conf file with master zone entries for all domains and subdomains found in the hosts file.
  5. Create zone files for all domains and subdomains.
    Create reverse zone files for all networks specified with the -n directive.
    (note that a zone is created for each 24 bit subnet).
    Zone files are created in the form pri.my.domain (forward) or pri.1.168.192.in-addr.arpa (reverse)
    (note that the prefix default is pri -primary- but can be changed with the -p option).
    As each zone is created, the program checks the target firectory for the existence of a file in the form
    spcl.my.domain
    If an spcl file is found, JH2N adds a #INCLUDE directive to the zone file to force the inclusion of the spcl file.
    A global default spcl file can be specified using the -G option. The global spcl file will only be included if no specific spcl file is found for a given zone.
  6. Create domainlist files.
    This special trick will result in the creation of a file that contians a list of all hostnames that match the text specified. See the -L and -l options below.

The host file may contain comments using a # in column 1.
Records must be formatted as follows:
10.10.10.10 full.domain.name [shortalias1 | alias.from.another.zone] [...]
Element description:
#1) IP address starting in column 1
whitespace
#2) fully qualified hostname (becomes the A or Address record)
whitespace
#3+)any number of aliases hostnames (become cnames to element #2)
non-fully qualified names become cnames in the same domain as element #2.
fully qualified hostnames become cnames in their own domains.

EXAMPLE:
10.10.10.10 host1.my.domain alias1 alias2 alias3.other.domian
would result in an A record for host1.my.domain to 10.10.10.10, alias1.my.domain.com as a CNAME to host1, and alias3.other.domain as a cname to host1.my.domain.
To make jh2n work properly, first create an instance, passing any command line args as a string array. Next use the readHostFile method to have it read the input file and build all the internal structures Next use the writeFiles method to get it to create the named.boot file, as well as all the db resource record files.
JH2N COMMAND LINE OPTIONS:

java com.sagestudio.jh2n.jh2n -48RhqV
-b named.configfile
-O "bindoption value;"
-D /default/folder
-L domainlist
-G spcl.global
-H /input/hostfile
-i ignore.this.domain
-l matchtext
-x "10 mail.exchanger"
-m dns1.my.domain
-s dns1.my.domain 
-n nn[.nn][.nn]
-f /input/jh2n_options
-P file.prefix.
-r root.cache
-p file.prefix.
-z named.conf.slave
-Z named.conf.slave.nosave
-o "refresh retry expire minimum"
-g spcl.prefix
-T integerTTLseconds 
-y keyword "option";
-Y zone keyword "option";


-4     
--bind4
Specifies the config files in bind version 4 format.
Not been used or tested for a while.
-4 and -8 are mutually exclusive.

-8     
--bind8
Specifies the config files in bind version 8 format. USE THIS.
-4 and -8 are mutually exclusive.

-b    named.configfile
--configfile
Specifies the name of the bind config file created by JH2N. [default:none]

-O    "bindoption value;"
--configoptions
Add options to the bind8+ config file.
Watch the quoting here. Recommend that these be placed in an input file with the format
-0  'keyword  "some values and such";'
Practically required now, as bind must be told where the zones files are located, i.e.-O 'directory "/home/craig/jh2n/named/zones";'
Multiple's may be specified.

-D    /default/folder
--defaultdirectory
All unqualified filenames specified in options and all output files will be found here. [default:./]

-L    domainlist
--domainlist
Specifies that list of all the zones processed should be created.
Handy for ISP's and list driven configs like sendmail.
Option is the name of the output file.

-R     
--getrootcache
Directs JH2N to download a new root zone file.
Currently from ftp://rs.internic.net/domain/named.root

-G    spcl.global
--globalinclude
Default global include file. If specified, all output zone files that do not have a
specific spcl file will have the named file $INCLUDE'd.

-h     
--help
Prints this list of command line options.

-H    /input/hostfile
--hostsfile
Specifies the name of the input file containing a list of all the hosts.
Format of this file is 
nnn.nn.nn.nn host.domain alias alias alias

-i    ignore.this.domain
--ignoredomain
Specify a domain or zone that should be dropped from all output files.

-l    matchtext
--listmatch
Writes a list of all host names that match the text specified.
Option is the text to match. The file is created in the default folder and named ${matchtext}domainlist.
Multiple's may be specified.

-x    "10 mail.exchanger"
--mailexchange
Specifies an MX record that can be included for every host processed.Watch the quoting here. Recommend that these be placed in an input file with the format
-x  '10 mail.exchanger'
Probably a really bad idea. Quotes are required. Multiple's may be specified.

-m    dns1.my.domain
--master
Specifies the name of the primary master BIND server.  [default: none] (REQUIRED) 

-s    dns1.my.domain 
--nameserver
Specifies the name of the BIND servers. Multiples _should_ be specified.

-n    nn[.nn][.nn]
--network
Lists the networks to be included from the hosts file.
Used for a basic pattern match on the hosts ip addresses.
-n 12.10 would include networks 12.100 and 12.10.20.
Multiple's may be specified. [default: none]

-f    /input/jh2n_options
--optionfile
Specify file containing additional options.

-P    file.prefix.
--primaryprefix
Allows the override of the prefix for the created zone files.  [default:pri.]

-q     
--quiet
Supress all the status output.

-r    root.cache
--rootcachefile
Specifiles the name of the root cach file. default is root.cache.

-p    file.prefix.
--secondaryprefix
Allows the override of the prefix for the slave zone files. [default:sec.]

-z    named.conf.slave
--slavefile
Specifies the name of a conf file to be created for use as a disk caching slave server.

-Z    named.conf.slave.nosave
--slavefilenosave
Specifies the name of a conf file to be created which for use on a non-disk caching slave server.

-o    "refresh retry expire minimum"
--soaintervals
Overrides the defualt SOA record time options. Format is:
-o refresh retry expire min   [default: 10800 3600 604801 86400]

-g    spcl.prefix
--spclprefix
Specify the file prefix that JH2N uses when looking to set a zone specific $INCLUDE in the RR file.
Default prefix is spcl., thus jh2n sets the include to spcl.$zonename.

-T    integerTTLseconds 
--ttl
Sets the default TTL inserted into all zone files. Default is 3600.

-V     
--version
Prints the version and licnese text.

-y    keyword "option";
--zonedefaultoption
Specifies a set of options to be inserted into all zone entries (except root and loopback).
Use this for special options to be added across all dynamic zones. Also good for DDNS settings.

-Y    zone keyword "option";
--zoneoption
Specifies a set of options to be inserted into specific zone entries.
Use this for special options to be added across all dynamic zones. Also good for DDNS settings.




jh2n - host to named conversion program Copyright (C) 1998-2001 Craig Nelson craig@sagestudio.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. or point your browser to http://www.gnu.org/copyleft/copyleft.html


Constructor Summary
jh2n_manual()
          Note that this class is bogus, and exists only for documenting the invocation methods for jh2n
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

jh2n_manual

public jh2n_manual()
Note that this class is bogus, and exists only for documenting the invocation methods for jh2n