11.4. Configuring DNS

11.4. Configuring DNS

Currently, the most common Linux DNS service is bind. This service is implemented by the bindconf utility, which has a graphical interface and is easy to use. To run the utility, open a console from the graphical mode and execute the following command:

 bindconf & 

The ampersand (&) specifies that the program is to be run in the background. When a graphical utility is launched in the background, it does not interfere with the console operations. Note, however, that when the console window is closed, all programs launched with the & option are also closed.

Fig. 11.2 shows the DNS configuration utility's main window. In the center of the main window, the dialog window for adding a domain is shown. All you have to do for adding a domain is select the zone type and specify the domain name .

image from book
Figure 11.2: DNS control windows

Even though DNS can be configured through the user -friendly graphical utility, I will consider doing this using the configuration files for the service. Editing them directly allows the service to be configured more precisely and will also enable you to understand the DNS operation process better.

The main DNS configuration file is /etc/named.conf. Listing 11.1 shows an example of the contents of this file.

Listing 11.1: An example of the contents of the /etc/named.conf file
image from book
 options {        directory "/var/named/"; }; zone  "." {        type hint;        file "named.ca"; }; zone  "sitename.com" {        type master;        file "sitename.zone"; }; zone  "10.12.190.in-addr.arpa" {        type master;        file  "10.12.190.in-addr.arpa.zone"; }; 
image from book
 

In this example, the file is broken into four sections of the following format:

 type name {  Parameter1;  Parameter2;  ... }; 

The functions of each section are as follows . The first section is options:

 options {        directory "/var/named/"; }; 

It contains only one parameter in braces: directory . It specifies the home directory of the DNS server, where all of its files will be stored.

The rest of the sections are of the zone type, with the zone name given in quotation marks. Each of the sections contains two parameters. The type parameter defines the zone type, and the file parameter defines the file containing the description of the zone.

The first zone in the example is described as follows:

 zone  "." {        type hint;        file  "named.ca"; }; 

What is this . zone? Recall the DNS theory presented at the beginning of the chapter. According to this theory, the DNS root domain is represented as a period. Thus, the section describes the root zone. The section type, hint , means that the server will only store links to the DNS server. Because this is the root zone, all links will be to the root servers.

The file parameter specifies the name of the file containing all links to the root servers. Your system may not have this file because the information in it is dynamic. It is the best to obtain the latest version of this file from the internic.net server. This is done by executing the following command:

 dig @rs.internic.net . ns > named.ca 

The next section describes the sitename.com zone:

 zone  "sitename.com" {        type master;        file "sitename.zone"; }; 

The zone type, master , means that your DNS server will be the main one, with the rest only verifying and caching DNS information. The information about this zone will be stored in the sitename.zone file in the work directory, which is /var/named in this case.

The next section describes reverse lookup of the 190.12.10.* IP addresses into host names :

 zone  "10.12.190.in-addr.arpa" {        type master;        file "10.12.190.in-addr.arpa.zone"; }; 

The zone type is master again.



Hacker Linux Uncovered
Hacker Linux Uncovered
ISBN: 1931769508
EAN: 2147483647
Year: 2004
Pages: 141

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net