کد:
http://articles.techrepublic.com.com/5100-10878_11-6180677.html
Takeaway: Linux can be intimidating for a Windows administrator because a lot of configuration for network services must be done from the command line. Jack Wallen shows how to configure a DNS server using GUI tools in Linux.

This article is also available as a TechRepublic download.


Before YaST, setting up DNS servers was a matter of hand-editing configuration files in Linux. This was tedious to those who didn't have the time to learn the details of the various .conf or .cf files required. Fortunately, the good people at Novell and SuSE worked hard to bring the Linux administrator the YaST (Yet another Setup Tool) to help. This tool makes setting up a plethora of system settings as simple as it gets.
Author's note

Our environment for this article will be OpenSuSE 10.2 and the GNOME 2.16 environment. Both are stable, robust, and very user-friendly. The installation of SuSE 10.2 was a complete install (read: five CDs full of software), so everything needed to set up a complete server is there. I highly recommend this method so you do not have to fight with dependencies should you have to install a piece of software for your server. After a complete install, you will have everything you need to set up DNS.
A quick look around YaST

Although it is contrary to what many Linux admins would advise, I'm going to log into my SuSE 10.2 machine as root for this setup. I don't do this often, but it saves me from having to enter the root password every time I want to perform an administration task. Once you are done setting up these services, log out.
The first thing you'll want to do is to select the Computer menu, as seen in Figure A.
Figure A

The new GNOME 2.16 menu is quite a change from the usual cascading menu. From the menu, select the Control Center entry. You'll see the screen shown in Figure B.
Figure B

The Control Center is grouped in both Groups and Common Tasks. From the Common Tasks section, select Administrator Settings to open the YaST Admin Tool. A screen similar to Figure C will appear; this is where you do most of your work.
Figure C

It should be obvious that Network Services is your next destination. Select Network Services to reveal a listing of the various Network Services that can be configured from within YaST, as shown in Figure D.
Figure D

A nice collection of GUI tools to help you configure your Linux server. You are ready to begin the task at hand.
Configuring DNS

DNS (Domain Name System) translates IP addresses to user-friendly URLs. So, instead of having to remember 216.109.112.135, you just have to remember yahoo.com. This is taken care of by DNS.
Setting up a DNS server with YaST is amazingly simple. The first step you need to take is to press the DNS Server button in the Network Settings of YaST. Once the new window opens, as shown in Figure E, the fun begins.
Figure E

You must choose whether the PPP daemon will set the DNS forwarders for you, or if you'll set them manually. A DNS forwarder is a DNS server that will send DNS requests to external (outside of your network) DNS servers when the internal DNS servers can not handle the request. Using this will make your DNS system more efficient.
Most likely, you will be configuring the forwarder manually. Enter the DNS server information of the DNS server from your provider, and press the Add button. Once you have entered all the necessary external DNS servers, press Next. Now you are ready to create a DNS zone.
A DNS zone is a fragment of the DNS namespace that has a designated responsibility. There is the root domain, which is akin to the "/" directory in Linux -- it holds everything. Then, there are the TLD (Top Level Domains), such as .net, .com, .org, .gov, and .edu. Each of these can be considered a zone and each has its own responsibility. The first step here is to enter the name of the new zone in the Add New Zone text area, as shown in Figure F.
Figure F

You can select from master (a primary or authoritative zone), slave (secondary zone), and forward zones (forwards requests). Once you have entered the name of the zone and selected the type of zone it represents, press Add and the new zone will appear in the Configured DNS Zones window. Once you've added a zone, there is more fun to be had. Highlight the newly-added zone and click the edit button to open the zone editor (Figure G).
Figure G

There are plenty of settings to deal with in the zone editor. In the zone editor you are able to do the following:

  • Enable Zone Transport: Allows zones to be transportable from one host to another. Shown in Figure H.
  • Add NS Records: Add a new host name where DNS information can be found. Shown in Figure I.
  • Add MX Records: Mail Exchange record. Helps to map out mail servers. Shown in Figure J.
  • Configure SOA Records: This is information stored in a DNS zone about that zone and about other DNS records. Shown in Figure K.
  • Edit Resource Records: Add various types of keys (Domain Name Translation, CNAME, NS, MX). Each different key has its own syntax, which can be found in RFC 2230. Shown in Figure L.

Figure H

Don't forget to select the proper ACL (Access Control List) to use with zone transport. Figure I

The new name server must not be an IP address. Figure J

The record with the smallest preference number will get the highest priority. Figure K

Each configuration option for the SOA record is defined in the left side. Figure L

The value of the record must be in IP address form. Once you have completed work in the Zone Editor, press OK to return to the main DNS Zone window. Press Next to continue.
Last steps

The final steps in the DNS configuration are nigh. Open the port in the firewall so DNS traffic can pass through. By default, it is off; select the check box next to Open Port In Firewall, as seen in Figure M.
Figure M

By selecting the Firewall details, you will be allowed to select which network interface will allow DNS traffic through. In this screen you are able to define if DNS is started manually or at boot. I highly recommend you have this set to start at boot, otherwise you are going to have to go back and manually start up DNS any time the server is restarted (which, granted is rare in Linux.)
From this screen, you can go into Expert mode. Don't let the name fool you; expert mode only applies to start up (see Figure N), with the only added feature being able to immediately start and stop DNS services with the click of a button and view log files (see Figure O).
Figure N

You can start the DNS server, stop the DNS server, or start and save the settings and reload at once. Figure O

You can define the type of log, as well as add other services to the DNS logging. Press Finish and your settings will be saved; the DNS services will be started as well.
Final thoughts

DNS was once a very tricky beast on Linux; no more. With the help of YaST, DNS has become a very simple task. Now, the biggest trick with this type of service is to understand the fundamentals of DNS itself




موضوعات مشابه: