Skip to main content

A look at DNS (part 2)

posted onOctober 22, 2000
by hitbsecnews

As promised, I shall wrap up what I started last month -- and give you guys a few examples of setting up a DNS server. Let's get started then.

DNS Name Lookup Files

It's time to really get into the guts of the named configuration file. A DNS name lookup file consists of three parts:

Header Information in the start of SOA record which identifies the domain the DNS server is providing authoratative information for, the person responsible for that domain, and a variety of parameters that are used to define when and for how long infomration from that DNS server can be used.

Basic information about he domain in NS and MX records, which respectively list the Name Server and Mail eXchanger for that domain.

The DNS entries (name/address pairings) themselves.

A sample section of named :

options {
directory "/var/named";
};
zone "." {
type hint;
file "named.ca";
};
zone "0.0.127.in-addr.arpa"{
type master;
file "named.local";
};

In any NS record, the IP address must be present in the file as well as in the reverse IP address mapping file. The MX record defines the Mail eXchanger for the domains which is the primary system that can send and receive mail for the users in the domains and most importantlyy the adminstrator responsible for the domain who was identified in the SOA record.

The reverse lookup file

The reverse name lookup file can be a little bit confusing at first, but once you understand what it actually does, it gets a little bit easier to understand. Again, the whole purpose of the name server is to covert human-readable names into the real IP address that computers need to communicate.

There are also many situations where a program needs to look up the name associated with a particular IP address. For instance, when someone comes to your websit, his IP address is recorded in your server logs. Reverse DNS allows you to look up the host name associated with that address, since the IP address really isn't very useful by itself. Security and authentication are other areas where reverse lookups can be important.

Since this is a reverse look up file, it contains information similar to that of the lookup file, except that its displayed backwards.

Getting a named.ca file

Getting yourself a copy of the file that defines the root servers on the Internet is fairly easy. The best way to get this file would be to ftp to ftp.internic.net, cd to the domain directory, and retrieve the named.ca. This file is not updated very often, so this is not something you'll need to do on a regular basis.

Adding DNS files to your startup and shutdown scripts

To start DNS on a Red Hat based system manually, just execute the following:

/etc/rc.d/init.d/named restart

Remember that named is the name of the program that manages DNS on RH systems. The command show shuts down any named processes that were running and then starts a new process using all of the current configuration files.

Do make sure that you have symbolic links for the /etc/rc.d/init.d/named with the name S47named which should exist in the directories /etc/rc.d/rc2.d and /etc/rc.d/rc3.d. These links will ensure that the DNS server is run in runlevels 2 and 3.

Do make sure that you also have symbolic links to the file /etc/rc.d/init.d/named with the name K45named in the directories /etc/rc.d/rc0.d /etc/rc.d/rc1.d and /etc/rc.d/rc2.d. These links on the other hand will make sure that the server is shutdown cleanly when passing through run levels 0, 1 and 2.

Final thoughts

As you can see, getting DNS up and running isn't very difficult. In essence, DNS is nothing more than an application that uses a bunch of files working together to specify the information provided by a specific DNS server. You will find most problems in DNS configuration files are due to typos. But even if you encounter difficulties, there are quite a few online guides and references.

Peace.

1.) Chasing the Wind (part 1) - Robert G. Farrell

2.) What's brewing with 3G? - Dhillon Andrew

3.) A look at DNS (part 2) - L33tdawg

4.) Chasing the Wind (part 2) - Robert G. Farrell

Source

Tags

Intel

You May Also Like

Recent News

Friday, November 29th

Tuesday, November 19th

Friday, November 8th

Friday, November 1st

Tuesday, July 9th

Wednesday, July 3rd

Friday, June 28th

Thursday, June 27th

Thursday, June 13th

Wednesday, June 12th

Tuesday, June 11th