hosts_to_named(1M) hosts_to_named(1M)
NAME [Toc] [Back]
hosts_to_named - translate host table to name server file format
SYNOPSIS [Toc] [Back]
hosts_to_named -d domain -n network-number [options]
DESCRIPTION [Toc] [Back]
hosts_to_named translates the host table, /etc/hosts, into files that
are usable by the name server named(1M). The format of these files is
defined in RFC 1035. The files are created in the current directory.
Once the host table is translated, the name server files can be
maintained directly, or the translation can be repeated after each
change to the host table.
If a line in the host table contains no domain names, all names on the
line are assumed to be in the default domain. The first domain listed
is the "default domain". If data is being created for more than one
domain or if certain options are used, there must be domain names in
the host table to determine which names belong in which domain.
The name server data is referred to as "resource records".
Options are:
-a network-number
Add the information about hosts in the local
domain from network network-number. This is the
same as the -n option except that no pointer (PTR)
data is created. This is useful when there are
multiple domains on a network and a different
server is handling the address-to-name mapping for
network-number.
-b bootfile Name the boot file bootfile. The default is
named.boot (if named is 4.x) or named.conf (if
named is 8.x or 9.x) in the current directory.
-c subdomain Create alias (CNAME) records for hosts in
subdomain of the default domain. When a subdomain
is delegated, it is useful to create aliases for
the old names in the default domain that point to
the new names in the subdomain. After creating
the alias (CNAME) records, ignore lines in the
host table that contain names in the subdomain.
This option can be used more than once on the
command line. This option requires domain names
in the host table. When the old names in this
domain are no longer used, they can be ignored
with the -e option. If the subdomain name does
not have dots, the default domain is appended to
subdomain.
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: August 2003
hosts_to_named(1M) hosts_to_named(1M)
-d domain Create data for domain. This option can be used
more than once on the command line if data is
being created for more than one domain. The first
domain listed is the "default domain". This
option requires domain names in the host table for
all hosts in domains except the default domain.
-e subdomain Eliminate lines from the host table that contain
names in the subdomain before translating. If the
subdomain name does not have dots, the default
domain is appended. This option may be used more
than once on the command line. This option
requires domain names in the host table.
-f file Read command line options from file. The -f
option is not allowed within a file.
-h host Declare host to be the host in the start of
authority (SOA) record that the name server data
was created on. Also use host for the electronic
mail address of the responsible user in the SOA
record. The default is the host this command is
run on. This option applies to all the domains
generated by hosts_to_named. If this option is
specified more than once, the last value will be
considered.
-m weight:mailhub
For each canonical hostname from the host table,
create mail exchanger (MX) records with the
specified weight and mail hub. The weight is a
positive integer. The mail hub is a hostname. If
the mail hub name has no dots, the default domain
is appended. This option can be used more than
once on the command line.
-n network-number[:mask]
Create data for network-number. See below for
description of network-number. If only one domain
is listed with -d, all data for network-number is
assumed to be in domain. The optional subnet mask
mask can be used instead of supplying each
network-number for a subnet using multiple -n
options. mask must be in dot notation. This
option is not applicable for creating IPv6
addresses.
-o refresh:retry:expire:min
Set the values in the start-of-authority (SOA)
record to those specified. See below for
description of the start-of-authority (SOA)
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: August 2003
hosts_to_named(1M) hosts_to_named(1M)
record.
-p domain Create only pointer (PTR) data for hosts in
domain. This is useful when there are multiple
domains on a network and a different server is
responsible for domain, but this server is
responsible for the address-to-name mapping. This
option can be used more than once on the command
line. This option requires domain names in the
host table.
-q Run quietly. No messages are printed.
-r Create name server data indicating that the name
server is authoritative for . (the root of the
domain tree). The file created is db.root. Use
this only when your network is isolated from the
Internet. If other root servers exist for the
isolated network, they must be added manually.
-s server Create name server (NS) records that declare
server is an authoritative name server for all of
the domains created. If more than one server is
authoritative, each needs to be declared. If the
server name does not have any dots in it, the
default domain is appended. If you do not specify
the -s option, the default name server is the host
on which you execute the script. You can use this
option more than once on the command line to
specify multiple name servers.
-t Create text (TXT) records from the comments that
appear with host data. The comments will all be
in lower case because the host table is translated
to lower case. If [no smtp] appears in a comment,
it is omitted. The [no smtp] is used to control
mail exchanger (MX) data.
-u user Declare user to be the electronic mail address of
the person responsible for this domain. This is
used in the start of authority (SOA) record. The
format required in the name server data is
user.host (host must be a domain name). If given
as user, the host on which this script is run is
appended. If given as user@host, the @ is
replaced with a dot (.). The default user is
root. This option applies to all the domains
generated by hosts_to_named. If you specify this
option more than once, the last value will be
used.
Hewlett-Packard Company - 3 - HP-UX 11i Version 2: August 2003
hosts_to_named(1M) hosts_to_named(1M)
-w Create well known services (WKS) data declaring
that the host provides the SMTP service. This is
done only when mail exchanger (MX) data is also
being created and only for hosts without [no smtp]
in a comment.
-z internet-address
Create a secondary boot file, boot.sec.save (if
named is 4.x) or conf.sec.save (if named is 8.x or
9.x), from the primary boot file listing
internet-address as the server to load the data
from. The boot file has the server back up the
data on disk. The internet-address defaults to
the value used with -Z. You can specify this
option more than once to declare multiple servers
from which data can be loaded.
Note: All the servers declared using this option
will be listed for all the domains.
-A Do not create name server data for aliases in the
host table.
-C file Create resource records from strings in the
comment field of the host table. Each string in
the comment field (except [no smtp] ) is searched
for in file. The format of file is a string, a
colon, and a resource record. If the string in
the comment field matches the string before the
colon in file, a resource record is added
consisting of the name of the host followed by
everything after the colon from the matching line
in file. For example, host information (HINFO)
records can be created by adding 360:IN HINFO
hp9000s360 hp-ux to file and adding 360 to
comments in the host table.
-D Do not create name server data for domain names in
the host table.
-F By default, the serial number is incremented for a
domain only if the data has changed (pointer (PTR)
data only). This option forces the serial number
to be incremented, even if the data has not
changed.
-H host-file Use host-file instead of /etc/hosts.
-M Do not create mail exchanger (MX) records for
hosts in the host table.
Hewlett-Packard Company - 4 - HP-UX 11i Version 2: August 2003
hosts_to_named(1M) hosts_to_named(1M)
-N mask Apply the default subnet mask mask to each
network-number specified with -n except for ones
with their subnet masks already provided. mask
must be in dot notation. This is the same as
supplying each network-number for a subnet using
multiple -n options.
-S server This option is the same as the -s option, but it
only applies to the last domain specified with -d
or the last network-number specified with -n.
This option is for when server is backing up some,
but not all, of the domains.
Note: At least one name server (either default or
explicitly declared using the -s option) will be
included in all the database files, in addition to
those declared using the -S option.
-Z internet-address
Create a secondary boot file, boot.sec (if named
is 4.x) or conf.sec (if named is 8.x or 9.x), from
the primary boot file listing internet-address as
the server to load the data from. The boot file
does not have the server back up the data on disk.
The internet-address defaults to value used with
-z. You can use this option more than once to
declare multiple servers from which data can be
loaded.
Note: All the servers declared using this option
will be listed for all domains.
-1 This option is obsolete.
hosts_to_named translates the host table to lower case to help
eliminate duplicate data. Since the name server treats uppercase and
lowercase as equivalent, names that differ only in case are considered
the same.
The hosts_to_named configuration file migration script does not add
the listen-on-v6 option to the named.conf file on dual stack machine.
In order to enable DNS services to listen on IPv6 interfaces, this
entry needs to be added manually.
Alias (CNAME) records are created for subdomains delegated with -c.
Lines from the host table that contain names in subdomains from -c and
-e are removed from the lowercase copy of the host table.
The host table is then used to create the name server data for each
network-number declared on the command line. Do not include the
trailing 0's in the network number. No distinction is made between
Hewlett-Packard Company - 5 - HP-UX 11i Version 2: August 2003
hosts_to_named(1M) hosts_to_named(1M)
class A, B, or C addresses nor is there any understanding of subnets
unless a subnet mask is supplied. Example network numbers are: 10
(for all addresses of the form 10.*.*.*), 10.1 (for addresses of the
form 10.1.*.*), or 10.2.2 (for addresses of the form 10.2.2.*).
Address (A) records are created for mapping hostnames to IP addresses.
Alias (CNAME) records are created for aliases of hosts that are not
multi-homed. The data are placed in a file named db.DOMAIN where
DOMAIN is the first part of the domain from the command line. For the
domain div.inc.com, the file is named db.div. All other name server
data goes in this file except the pointer (PTR) records described
below.
Pointer (PTR) records are created for mapping IP addresses to host
names. PTR records are placed in a file named db.NET where NET is the
network number from the command line. Network 10 data is placed in
db.10. Network 10.1 data are placed in "db.10.1".
Address (AAAA) records and A6 records are created for mapping
hostnames to IPv6 addresses.
Pointer (PTR) records are created for mapping IPv6 addresses to host
names. The IPv6 PTR records are placed in a file named db.IP6.INT.
Mail exchanger (MX) records are created unless the -M option is used.
The default MX record has a weight of 10 with the host itself as its
mail exchanger. No default MX record is created for a host if [no
smtp] is in the comment section of that line in the host table. MX
records for each mail hub declared with the -m option are added for
each host even if [no smtp] is in the comment section.
Well known services (WKS) records are created for each host that
handles SMTP mail (does not have [no smtp]) if -w is used. The only
service listed is SMTP.
Text (TXT) records are created for comments associated with hosts in
the host table if -t is used. The comments do not include [no smtp].
For each domain, a start of authority (SOA) record is created. The
SOA record requires two domain names: the host that the data is
created on and the electronic mail address of the person responsible.
The -h and -u options influence the names. In addition, the SOA
record requires 5 values: a serial number, a refresh time, a retry
time, an expire time, and a minimum ttl (time to live). The first
time the data is created, the serial number is set to 1, the refresh
time is set to 3 hours, the retry time is set to 1 hour, the expire
time is set to 1 week, and the minimum ttl is set to 1 day. The -o
option changes these values except for the serial number. Each
subsequent time hosts_to_named is run, the serial number is
incremented. If any of the other fields in the SOA record are
modified, the changed values are retained.
Hewlett-Packard Company - 6 - HP-UX 11i Version 2: August 2003
hosts_to_named(1M) hosts_to_named(1M)
If there are files named spcl.DOMAIN or spcl.NET in the current
directory, $INCLUDE directives are added to the corresponding
db.DOMAIN or db.NET file for the spcl file. In this way, special data
can be added to the data generated by hosts_to_named.
The first time hosts_to_named is run, it creates a default boot file
for a primary name server. Each subsequent time hosts_to_named is
run, the boot file is updated if necessary. New entries are made in
the boot file for any additional networks or domains not already in
the boot file. No entries are deleted from the boot file.
The boot file for a caching-only server, boot.cacheonly (if bind is
4.x) or conf.cacheonly (if bind is 8.x or 9.x), is created if it does
not exist. The boot files for secondary servers, (boot.sec.save or
conf.sec.save) and (boot.sec or conf.sec), are created if the -z or -Z
options are used. The boot files for secondary servers are created
new each time from the primary server boot file so that they are
equivalent.
EXAMPLES [Toc] [Back]
Create name server data for networks 15.19.8 and 15.19.9 in
div.inc.com.
hosts_to_named -d div.inc.com -n 15.19.8 -n 15.19.9
Create name server data for networks 15.19.8 and 15.19.9 in
div.inc.com. Ignore aliases in the host table and include two mail
hubs - aaa.div.inc.com and bbb.mkt.inc.comk. Put all of the options
in a file.
hosts_to_named -f option_file
Option_file contains the following lines:
-d div.inc.com
-n 15.19.8 -n 15.19.9
-m 20:aaa
-m 30:bbb.mkt.inc.com
-A
Network 15.19.15 has hosts in the xx.inc.com domain and the
div.inc.com domain. Create name server data for xx.inc.com. Create
only pointer (PTR) data for hosts in div.inc.com on network 15.19.15
(this requires the hosts in div.inc.com to have the canonical name or
an alias of the form x.div.inc.com).
hosts_to_named -d xx.inc.com -n 15.19.15 -p div.inc.com
Create name server data for network 15.19.8 in div.inc.com. Include
div.inc.com data from network 15.19.15 but do not create pointer (PTR)
data for 15.19.15 since that is being handled by the xx.inc.com
Hewlett-Packard Company - 7 - HP-UX 11i Version 2: August 2003
hosts_to_named(1M) hosts_to_named(1M)
server.
hosts_to_named -d div.inc.com -n 15.19.8 -a 15.19.15
Create name server data for multiple domains div1.inc.com,
div2.inc.com and div3.inc.com. You must declare 15.18.1.1 as the host
in the start of authority (SOA) record for all the domains. Also,
create a secondary boot file from the primary boot file listing
15.18.1.1 and 15.18.2.1 as the servers to load the data from, to all
the domains. Declare 15.18.2.1 as an authoritative name server for
the domain div2.inc.com in addition to the default server.
hosts_to_named -f option_file
Option_file contains the following lines:
-d div1.inc.com
-n 15.18.1
-d div2.inc.com
-n 15.18.2
-S 15.18.2.1
-d div3.inc.com
-n 15.18.3
-h 15.18.1.1
-z 15.18.1.1
-z 15.18.2.1
AUTHOR [Toc] [Back]
hosts_to_named was developed by HP.
FILES [Toc] [Back]
/etc/hosts The host table
named.boot Primary server boot file (4.x)
named.conf Primary server boot file (8.x or 9.x)
boot.cacheonly Caching only server boot file (4.x)
conf.cacheonly Caching only server boot file (8.x or
9.x)
boot.sec.save Secondary server boot file (4.x)
conf.sec.save Secondary server boot file (8.x or 9.x)
boot.sec Secondary server boot file (4.x)
conf.sec Secondary server boot file (8.x or 9.x)
db.127.0.0 Pointer information for 127.0.0.1
db.cache Stub cache file for root server
addresses
Hewlett-Packard Company - 8 - HP-UX 11i Version 2: August 2003
hosts_to_named(1M) hosts_to_named(1M)
db.root Data for servers for the root domain
db.DOMAIN Address and other data for a domain
db.DOMAIN.in-addr Pointer data for all network-numbers
db.NET Pointer data for a network-number
db.IP6.INT Pointer data for a IPv6 network-number
SEE ALSO [Toc] [Back]
named(1M).
RFC 1034, RFC 1035.
Hewlett-Packard Company - 9 - HP-UX 11i Version 2: August 2003 [ Back ] |