Configuring domain name servers - BIND version 9.4
In this scenario, a controller name server, worker name server, and hint name server will be configured to perform name resolution. Each name server will be a separate machine, and each will have an /etc/named.conf file configured, although the information in each will be different. The /etc/named.conf is read each time the named daemon is started, and it specifies what type of server it is (controller, worker, or hint) and where it will get its name resolution data. Each of these name servers will be running BIND 8.
The controller name server will be configured to provide name resolution for the
abc.aus.century.com
zone. In this scenario, the IP address of the controller name
server is 192.9.201.1
, and its host name is
venus.abc.aus.century.com
. It will provide name resolution for the venus, earth,
mars, and jupiter host names. The /etc/named.conf file will be configured to
specify that the named daemon should search the
/usr/local/domain directory for its data files. The data files that will be
configured for the controller name server are named.ca,
named.abc.local, named.abc.data, and
named.abc.rev.
A worker name server will then be configured. The host name of the worker name server will be
earth.abc.aus.century.com
, and its IP address will be 192.9.201.5
.
In the worker name server's /etc/named.conf file, we will specify the
controller name server's address so that the worker name server can replicate the controller name
server's named.abc.data and named.abc.rev files. In
addition, the named.ca and named.abc.local data files will
be configured for this server.
A hint name server will then be configured. The hint name server will store a local cache of host name and address mappings. If a requested address or host name is not in its cache, the hint server will contact the controller name server, get the resolution information, and add it to its cache. In addition, the named.ca and named.abc.local data files will be configured for this server.
All information in the named data files (not the /etc/named.conf file) on the name servers must be in the Standard Resource Record Format. For explanations about the information about the named data files, see Standard Resource Record Format for TCP/IP in Files Reference.
The administrator
for each of the name servers will be gail.zeus.abc.aus.century.com
.
This is specified in the local data files on each name server. In
addition, in this scenario, the root name server is relay.century.com
with
IP address 129.114.1.2
.
At the end of this scenario, name resolution will be provided for the hosts venus, earth, mars,
and jupiter. In addition, reverse name resolution (IP address-to-host name) will also be provided.
When a request is received that cannot be resolved, the controller name server will contact
relay.century.com
to find the information needed.
- The information in this how-to scenario was tested using specific versions of AIX®. The results you obtain might vary significantly depending on your version and level of AIX.
Step 1. Configure the Controller Name Server
- On the controller name server, open the /etc/named.conf file. If there is
no /etc/named.conf file in the /etc directory, create one
by running the following command:
touch /etc/named.conf
Do the following to configure the /etc/named.conf file:- Specify a directory clause in the options stanza. This enables the named
data files to use paths relative to the /usr/local/domain directory. In this
scenario, the following was added:
options { directory "/usr/local/domain"; };
- To allow record data to be cached outside of the defined zones, specify the name of the hint
zone file. In this scenario, the following was added:
zone "." IN { type hint; file "named.ca"; };
- Add the following stanzas to specify each zone, the type of name server you are configuring, and
your name server's domain data file. In this scenario, the controller server for both forward and
reverse zones is the following:
zone "abc.aus.century.com" in { type master; file "named.abc.data"; }; zone "201.9.192.in-addr.arpa" in { type master; file "named.abc.rev"; };
- Define the name of the named local file. For example:
After editing the file, save and close it.zone "0.0.127.in-addr.arpa" in { type master; file "named.abc.local"; };
- Specify a directory clause in the options stanza. This enables the named
data files to use paths relative to the /usr/local/domain directory. In this
scenario, the following was added:
- Open the /usr/local/domain/named.ca file.
Add the addresses of the root name servers for the domain. The following
was added in this scenario:
After editing the file, save and close it.; root name servers. . IN NS relay.century.com. relay.century.com. 3600000 IN A 129.114.1.2
- Open the /usr/local/domain/named.abc.local file.
Add the following information:
- The start of authority (SOA) of the zone and the default time-to-live
information. The following was added in this scenario:
$TTL 3h ;3 hour @ IN SOA venus.abc.aus.century.com. gail.zeus.abc.aus.century.com. ( 1 ;serial 3600 ;refresh 600 ;retry 3600000 ;expire 3600 ;negative caching TTL )
- The name server (NS) record. Insert a tab space at the beginning
of the line; the named daemon will replace the
tab space with the zone name:
<tab> IN NS venus.abc.aus.century.com.
- The pointer (PTR) record.
After editing the file, save and close it.1 IN PTR localhost.
- The start of authority (SOA) of the zone and the default time-to-live
information. The following was added in this scenario:
- Open the /usr/local/domain/named.abc.data file.
Add the following information:
- The start of authority of the zone and the default time-to-live
information for the zone. This record designates the start of a zone.
Only one start of authority record per zone is allowed. In this scenario,
the following was added:
$TTL 3h ;3 hour @ IN SOA venus.abc.aus.century.com. gail.zeus.abc.aus.century.com. ( 1 ;serial 3600 ;refresh 600 ;retry 3600000 ;expire 3600 ;negative caching TTL )
- The name server records for all controller name servers in the zone. Insert a tab space at the
beginning of the line; the named daemon will replace the tab space with the zone
name:
<tab> IN NS venus.abc.aus.century.com.
- The name-to-address resolution information on all hosts in the
name server zone of authority:
venus IN A 192.9.201.1 earth IN A 192.9.201.5 mars IN A 192.9.201.3 jupiter IN A 192.9.201.7
After editing the file, save and close it.
- The start of authority of the zone and the default time-to-live
information for the zone. This record designates the start of a zone.
Only one start of authority record per zone is allowed. In this scenario,
the following was added:
- Open the /usr/local/domain/named.abc.rev file.
Add the following information:
- The start of authority of the zone and the default time-to-live
information. This record designates the start of a zone. Only one
start of authority record per zone is allowed:
$TTL 3h ;3 hour @ IN SOA venus.abc.aus.century.com. gail.zeus.abc.aus.century.com. ( 1 ;serial 3600 ;refresh 600 ;retry 3600000 ;expire 3600 ;negative caching TTL )
- Other types of entries, such as name server records. If you are
including these records, insert a tab space at the beginning of the
line; the named daemon will replace the tab space
with the zone name. In this scenario, the following was added:
<tab> IN NS venus.abc.aus.century.com.
- Address-to-name resolution information on all hosts to be in the
name server's zone of authority.
After editing the file, save and close it.1 IN PTR venus.abc.aus.century.com. 5 IN PTR earth.abc.aus.century.com. 3 IN PTR mars.abc.aus.century.com. 7 IN PTR jupiter.abc.aus.century.com.
- The start of authority of the zone and the default time-to-live
information. This record designates the start of a zone. Only one
start of authority record per zone is allowed:
- Create an /etc/resolv.conf file by running
the following command:
touch /etc/resolv.conf
The presence of this file indicates that the host should use a name server for name resolution.
- Add the following entry in the /etc/resolv.conf file:
nameserver 127.0.0.1
The
127.0.0.1
address is the loopback address, which causes the host to access itself as the name server. The /etc/resolv.conf file can also contain an entry similar to the following:
In this case,domain abc.aus.century.com
abc.aus.century.com
is the domain name.After editing the file, save and close it.
- Use the smit stnamed SMIT fast path to enable the named daemon. This initializes the daemon with each system startup. Indicate whether you want to start the named daemon now, at the next system restart, or both.
Step 2. Configure the Worker Name Server
To configure a worker name server, use the following procedure. You will edit a series of files and then use SMIT to start the named daemon.
- On the worker name server, open the /etc/named.conf file. If there is no
/etc/named.conf file in the /etc directory, create on by
running the following command:
touch /etc/named.conf
Do the following to configure the /etc/named.conf file:
- Specify a directory clause in the options stanza. This enables the named
data files to use paths relative to the /usr/local/domain directory. In this
scenario, the following was added:
If you choose not to specify a directory here, the named daemon will search the /etc directory for the necessary data files.options { directory "/usr/local/domain"; };
- To allow record data to be cached outside the defined zones, specify the name of the hint zone
file for the name server:
zone "." IN { type hint; file "named.ca"; };
- Specify the slave zone clauses. Each stanza includes the zone type, a file name to which the
name server can back up its data, and the IP address of the controller name server, from which the
worker name server will replicate its data files. In this scenario, we added the following slave
zone clauses:
zone "abc.aus.century.com" IN { type slave; file "named.abc.data.bak"; masters { 192.9.201.1; }; };
zone "201.9.192.in-addr.arpa" IN { type slave; file "named.abc.rev.bak"; masters { 192.9.201.1; }; };
- To support resolving the loopback network address, specify a zone of type master with a
source of
named.abc.local
, as well as the domain for which the name server is responsible.zone "0.0.127.in-addr.arpa" in { type master; file "named.abc.local"; };
- Specify a directory clause in the options stanza. This enables the named
data files to use paths relative to the /usr/local/domain directory. In this
scenario, the following was added:
- Edit the /usr/local/domain/named.ca file.
This file contains the address server that is the root domain server of the network. In this scenario, the following was added:After editing the file, save and close it.
; root name servers. . IN NS relay.century.com. relay.century.com. 3600000 IN A 129.114.1.2
- Open the /usr/local/domain/named.abc.local file.
In this scenario, the following was added:
- The start of authority (SOA) of the zone and the default time-to-live
information:
$TTL 3h ;3 hour @ IN SOA earth.abc.aus.century.com. gail.zeus.abc.aus.century.com. ( 1 ;serial 3600 ;refresh 600 ;retry 3600000 ;expire 3600 ;negative caching TTL )
- The name server (NS) record. Insert a tab space at the beginning
of the line; the named daemon will replace the
tab space with the zone name. For example:
<tab> IN NS earth.abc.aus.century.com.
- The pointer (PTR) record.
1 IN PTR localhost.
- The start of authority (SOA) of the zone and the default time-to-live
information:
- Create an /etc/resolv.conf file by running
the following command:
touch /etc/resolv.conf
- Add the following entry to that file:
After editing the file, save and close it.nameserver 127.0.0.1 domain abc.aus.century.com
- Use the smit stnamed SMIT fast path to enable the named daemon. This initializes the daemon with each system startup. Indicate whether you want to start the named daemon now, at the next system restart, or both.
Step 3. Configure the Hint Name Server
- On the hint name server, edit the /etc/named.conf file.
If there is no /etc/named.conf file in the /etc directory,
create one by running the following command:
touch /etc/named.conf
Do the following to configure the /etc/named.conf file:
- Specify a directory clause in the options stanza. This enables
the named data files to use paths relative to
the /usr/local/domain directory. In this scenario,
the following was added:
options { directory "/usr/local/domain"; };
- To support resolving the loopback network address, specify a zone
of type master with a source of named.abc.local,
as well as the domain for which the name server is responsible. In
this example, the options directory keyword was specified in the /etc/named.conf file.
zone "0.0.127.in-addr.arpa" IN { type master; file "named.abc.local"; };
- Specify the name of the cache zone file. For example:
zone "." IN { type hint; file "named.ca"; };
- Specify a directory clause in the options stanza. This enables
the named data files to use paths relative to
the /usr/local/domain directory. In this scenario,
the following was added:
- Edit the /usr/local/domain/named.ca file.
This file contains the addresses of the servers that are authoritative name servers for the root domain of the network. For example:
; root name servers. . IN NS relay.century.com. relay.century.com. 3600000 IN A 129.114.1.2
- Edit the /usr/local/domain/named.local file.
In this scenario, the following information was added to this file:
- The start of authority (SOA) of the zone and the default time-to-live
information:
$TTL 3h ;3 hour @ IN SOA venus.abc.aus.century.com. gail.zeus.abc.aus.century.com. ( 1 ;serial 3600 ;refresh 600 ;retry 3600000 ;expire 3600 ;negative caching TTL )
- The name server (NS) record. Insert a tab space at the beginning
of the line; the named daemon will replace the
tab space with the zone name:
<tab> IN NS venus.abc.aus.century.com.
- The pointer (PTR) record.
1 IN PTR localhost.
- The start of authority (SOA) of the zone and the default time-to-live
information:
- Create an /etc/resolv.conf file by running
the following command:
touch /etc/resolv.conf
- Add the following entry to that file:
After editing the file, save and close it.nameserver 127.0.0.1 domain abc.aus.century.com
- Use the
smit stnamed
SMIT fast path to enable the named daemon. This initializes the daemon with each system startup. Indicate whether you want to start the named daemon now, at the next system restart, or both.
Configuring domain name servers - BIND Version 9.16
For information about configuring domain name servers in BIND version 9.16, see the following topics: