The master configuration file for your DNS server is the /etc/named.conf file. Listing 23-3 shows an example of this file. This file is based on the file that is generated when you create a DNS server with YaST; note that I have removed some comment lines in this excerpt for better readability.

Listing 23-3. Example /etc/named.conf File

SFO:/etc # cat named.conf options {

# The directory statement defines the name server's working directory directory "/var/lib/named";

# The listen-on record contains a list of local network interfaces to

# listen on. Optionally the port can be specified. Default is to

# listen on all interfaces found on your system. The default port is

# The listen-on-v6 record enables or disables listening on IPv6

# interfaces. Allowed values are 'any' and 'none' or a list of

# addresses.

# The following zone definitions don't need any modification. The first one

# is the definition of the root name servers. The second one defines

# localhost while the third defines the reverse lookup for localhost.

type hint; file "root.hint";

zone "localhost" in { type master; file "";

zone "" in { type master; file "";

# Include the meta include file generated by createNamedConflnclude. This

# includes all files as configured in NAMED_CONF_INCLUDE_FILES from

# /etc/sysconfig/named include "/etc/named.conf.include"; zone "" in {

allow-transfer { any; }; file "master/"; type master;

zone "" in {

file "master/"; type master;

# You can insert further zone records for your own domains below or create

# single files in /etc/named.d/ and add the file names to


# See /usr/share/doc/packages/bind/README.SUSE for more details.

As you can see, this example configuration file contains everything to create a working DNS server. Some options are defined but commented out to make sure they are not used right away. In this configuration file, the following settings are effective:

options { ____ };:The named.conf file starts with a large section that has the name options.

Many of the options mentioned in this list are defined within this section. Note that the section options is opened with options {, and then a list of all options that are included follows; further in the file, the section is closed by a }; construction.

directory "/var/lib/named";: This parameter defines the location where all DNS configuration files are stored. See the next section for more details. Also note the semicolon that is used at the end of the line, which is an important syntax feature.

notify no;: This option indicates that slave servers should not be notified of changes. This leaves it completely to the slave server to make sure it is up-to-date. If you want an alert to be sent to a slave server when a change occurs, change this setting to notify yes;.

include "/etc/named.conf.include";: This refers to an additional configuration file that you can use to include extra information that should be used by your DNS server.

zone ... { ...};: This structure defines the zone files. As you can see, some default zones are present to refer to the root of the DNS domain, localhost, and the reverse DNS zone for the local domain.

Amongst the most important options of the DNS server is the definition of the zones. As you can see, the first zone defined is as follows:

This refers to the root of the DNS domain. You need this definition; otherwise, your server wouldn't be able to find the name servers for the root domain. Therefore, this zone definition indicates that a list of name servers for the root domain can be found in the file root.hint. As you can see, no absolute path name is provided for this file; the path mentioned here is relative to the directory that is referred to with the directory "/var/lib/named" option. Therefore, named would expect the file root.hint to be present in that directory.

Another interesting example of the zone definition is the part where is defined:

zone "" in {

allow-transfer { any; }; file "master/"; type master;

As you can see, in the previous definition of, all options that are valid for that zone appear between brackets. The first option you see is allow-transfer { any; };.This makes sure all hosts are allowed to do a zone transfer to your host. If you want to limit zone transfers to some hosts only, replace any with an IP address. Next, for this zone you can see the file master/ is referred to, which means you can expect this file to be present in the directory /var/lib/named/master/ on your server. As the last definition, you can see that this server is defined as the master for the zone.

Was this article helpful?

0 0

Post a comment