Configuring a DNS Server with YaST

YaST has a DNS Server module, which can be found in the Network Services section of the YaST menus, or can be called from the command line with the command yast2 dns-server.

In the example in this section, you set up a simple DNS server using this module. As with YaST's DHCP server module (see Chapter 20), the behavior you see when running this module differs according to whether YaST finds a previously configured setup. If previous configuration files are not found, YaST runs as a wizard the first time, allowing you to enter the necessary information in sequence. Subsequently, the YaST module allows you to make changes in any part of the configuration. You now create a name server for a domain (testdomain.com) with just two hosts, hatter and boojum. The host hatter is the name server (where you are working) and has the IP address 192.168.1.1; boojum is 192.168.1.2.

When you run the module, you are asked in the first screen (see Figure 21-1) to set the IP addresses of forwarders (these are the DNS servers that the server asks for when it cannot answer all queries). In this example, you set two external forwarders.

FIGURE 21-1

Setting forwarders

FIGURE 21-1

Setting forwarders

The next screen (see Figure 21-2) asks you to define zones. You need at least two: the zone testdomain.com and the reverse zone for the IP network concerned, which is 1.168.192.in-addr.arpa.

Now you define the name server(s) for the zone testdomain.com, which is the host hatter. Notice, as shown in Figure 21-3, that YaST completes the entry to hatter.testdomain.com.

Next, by selecting the domain and clicking the Edit button, you define records in the zone testdomain.com and the corresponding reverse records for the two hosts hatter and boojum (as shown in Figures 21-4 and 21-5). Choosing PTR as the record type automatically makes the entries in the reverse lookup zone.

FIGURE 21-2

Defining zones

FIGURE 21-2

Defining zones

FIGURE 21-3

Defining NS records

FIGURE 21-3

Defining NS records

FIGURE 21-4

Creating A records

FIGURE 21-4

Creating A records

FIGURE 21-5

Creating PTR records

FIGURE 21-5

Creating PTR records

Having added the required records, the wizard shows a summary of the information that it is going to write to the system (see Figure 21-6). When you click Finish, it writes the configuration files and exits.

FIGURE 21-6

YaST's DNS Server module wizard completes.

FIGURE 21-6

YaST's DNS Server module wizard completes.

Now, on hatter you can restart the name server (renamed restart) and modify /etc/resolv.conf so that you are sure that you are querying the new name server on hatter itself:

search testdomain.com nameserver 192.168.1.1

Now, a query using dig produces the expected result:

[email protected] # dig boojum.testdomain.com ; <<>> DiG 9.4.1-P1 <<>> boojum.testdomain.com ;; global options: printcmd ;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12836 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1 ;; QUESTION SECTION:

;boojum.testdomain.com. IN A

;; ANSWER SECTION:

boojum.testdomain.com. 172800 IN A 192.168.1.2

Was this article helpful?

0 0

Post a comment