com.sagestudio.jh2n
Class jh2n_manual

java.lang.Object
  extended bycom.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.
    Discard and/or alert on records that are duplicates or have some other issue.
  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.

JH2N can be invoked from a UNIX or DOS command prompt, passing it the proper command-line options specified below or garnered from the examples that are distributed in this package.
JH2N COMMAND LINE OPTIONS:
java com.sagestudio.jh2n.jh2n -48RhtV
        -A abort-level(1-4)
        -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.
        -p file.prefix.
        -r root.cache
        -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";


-A    abort-level(1-4)
--abortlevel
        Overrides the error level that will abort the run.  [default: 4]
        When a run aborts, no files are output
        0  	Debugging Messages - probably doesn't make sense
        1  	Informational Messages - probably doesn't make sense
        2  	Warnings and FYI's
                example: duplicate hostname A records, can be used for round-robin.
                example: duplicate PTR records, also can be used for round robin (but not so useful).
        3 	Correctable error restricted to the current line, displays the corrective action taken
                examples: duplicate aliases on the current line are discarded
                examples: aliases duplicating the hostname on the current line are discarded
        4 	correctable error at the global level (reserved for future expansion)
        5 	non-correctable error at the global level
                These types of errors can lead to a corrupt zone and freaky behavior in bind.
                example: alias on this line already exist in the system, run should be aborted
                example: alias on this line duplicates A record in the system, run should be aborted
                example: A record for this line duplicates an existing CNAME record, run should be aborted

-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

        This can be specified multiple times.

-i    ignore.this.domain
--ignoredomain
        Specify a domain or zone that should be dropped from all output files.
        . (dot) is a special case and will prevent the creation of entries for the root.cache files.
        -r must not be set for the -i '.' setting to work drop root.cache 
        Use this in cases where you have a special root.cache file.
        multiples may be specified

-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'

        Left in for compatibility with h2n.pl
        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 only 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: no setting = everything inlcuded]

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

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

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

-t    
--ptrdups
        Allows the creation of duplicate PTR records.
        Default behavior is to not create duplicate PTR records,
        the first PTR record found is kept, subsequent records are discared.
        Round robin ptrs are fine and all that, but can be confusing...

-q    [optional error-level(1-4)]
--quiet
        Overrides the level that will display messages.  [default: 1]
        See the abortlevel option for a description of the levels
        -q0  	Show debug messages messages.
        -q1  	Show all non-debugging messages - level 1+.
        -q2  	Supress run and informational messages.
        -q3  	Supress level run, info, warnings, and FYI messages.
        -q4  	supress info, warning, FYI, and correctable error messages.
        -q5  	supress info, warning, FYI, correctable, and global correctable error messages.
        -q6  	supress everything, probably a bad idea.


-r    root.cache
--rootcachefile
        Specifiles the name of the root cach file. default is root.cache.
        Note that root cache inclusion can be disabled by not setting -r and setting -i '.'

-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 license 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-0.95)



  JH2N - host to named conversion program
   Copyright (C)1998-2004 Craig Nelson & SageStudio 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

Author:
Craig Nelson

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