PDA

View Full Version : Basic DNS How-To


GrapeShot
19th August 2007, 01:13 AM
This how to is meant to assist anyone who is interested in running their own DNS. The tutorial was written using F7 and the GUI tool for DNS configuration (system-config-bind)but should be okay for those using FC6 as well. It covers making a single forward and reverse zone, records for hosts on the network, MX records and CNames.

To start the DNS configuration program, make sure you have the NAMED service running and that system-conf-g-bind is installed. If they are not installed, as root run
yum install system-config-bind bind
chkconfig --levels 235 named on
To start the BIND configuration program, locate and click on the icon for Domain Name System or as root run
system-config-bind
You may see a message "No BIND configuration was found. Installing the initial default configuration." Click OK

CREATE FORWARD ZONE
Ensure the entry for DNS Server is selected and click New icon and choose Zone from the pop up list.

The New Zone window appears.

1. Inside of the Origin option group:
-For class IN Internet and click OK
-For Origin Type choose Forward and click OK
-Enter the name of your domain (example.com.). Remember the trailing period. If you don't a window will appear letting you know that the period has been appended for you.

2. Inside of Zone Type
-Choose Master and click OK
3. Zone Authority Information for the zone that was just created is now displayed
-Check to make the Authoritative Name Server and the Responsible Person E-Mail Address information is correct.
-The default settings for the other items are fine. Click OK.

CREATE REVERSE ZONE
Ensure the entry for DNS Server is selected and click New icon and choose Zone from the pop up list.

The New Zone windows appears.

1. Inside of the Origin option group select:
-For Class IN Internet and click OK
-For Origin Type choose IPV4 Reverse
-Enter the first octet of your network range (i.e. the 192 in 192.168.0.x) and click Add
-Repeat the above steps for the second and third octets
2. Inside of Zone Type
-Choose Master and click OK
3. Zone Authority Information for the zone that was just created is now displayed
-Check to make the Authoritative Name Server and the Responsible Person E-Mail Address information is correct.
-The default settings for the other items are fine. Click OK.

CREATE RECORDS
Click on the arrow to expand the forward look up zone (example.com). The information contained inside of your zone is displayed below the zone name.

HOST RECORDS
The section covers how to create the most common type of record - the host record.
-Click on the New icon and choose "A IPV4"
-Enter the hostname of the systems that you are creating the record for in the Domain Name box. You do not need to include the fully qualified domain name as the domain name will be automatically appended to the hostname.
:) note: I always create record for the domain name itself and point it toward my web server. This allows users to view my website by just typing in the domain name. No "www" is needed. To do this, do not enter a hostname as described above just enter the domain name followed by a period.
-From the "Select IPv4 Prefix", select the IPv4 reverse zone that the host is going to belong to. For example, a host with IP address 192.168.0.10 would belong to the 192.168.0 prefix group. Enter the final octet in the fourth box under IPv4 Address.
-It is recommended that you generate a reverse mapping for this record. To do that, ensure that the "Create Reverse Mapping Record" box is checked.
-Click OK. Do the above steps for each host on your network that your other systems on your network will need to communicate with. Examples would be print severs, SMTP, IMAP, POP, web servers and file servers.
MX RECORDS
MX or Mail Exchange records are needed for most mail systems to function properly. The following steps will guide you through the process of setting up this record.
-Ensure the SMTP servers forward record has been entered into the DNS as described in the section HOST RECORDS
-Click on the New icon and choose "MX Mail Exchange"
-The MXMail Exchange will appear. Ensure that the domain that the mail server will be a part of is in the Domain Name box.
-Choose a priority for the mail server. This is important if you have more than one SMTP server on your network. Other mail servers will attempt to deliver mail to the mail server with the lowest priority first. If that fails, it will attempt the mail server with the next higher priority and so on.
-Enter the hostname of the SMTP server for the domain in the Mail Server Name box. You do not need to include the fully qualified domain name as the domain name will be automatically appended to the hostname.
CNAME RECORDS
CName or Canonical Names are aliases for other systems on your network. For example, you may want mail.example.com to resolve to smtp01.example.com on your network. The below steps will help you create a canonical name.
-Click on the New icon and choose "CNAME Alias"
-Enter the alias name in the Domain Name box (i.e. mail). You do not need to include the fully qualified domain name as the domain name will be automatically appended to the hostname.
-In the Canonical Name box, enter the hostname of the system you want alias to point to (i.e. smtp01)

That concludes this tutorial on how to setup and configure a basic DNS for your network. There are a lot of other options in the DNS such as zone replication to slave servers. As time permits, I include sections in this tutorial for setting other options up in the DNS.

Enjoy!

GrapeShot

stevea
19th August 2007, 01:24 AM
Sweet - thanks sincerely.

kenneth_phough
19th August 2007, 04:39 AM
Thanks! This helped me alot :)
Regards,
Kenneth

vtstarin
15th September 2007, 05:13 PM
thanx..lot..

benso37
21st September 2007, 07:15 PM
This how to is meant to assist anyone who is interested in running their own DNS. The tutorial was written using F7 and the GUI tool for DNS configuration (system-config-bind)but should be okay for those using FC6 as well. It covers making a single forward and reverse zone, records for hosts on the network, MX records and CNames.

To start the DNS configuration program, make sure you have the NAMED service running and that system-conf-g-bind is installed. If they are not installed, as root run
yum install system-config-bind bind
chkconfig --levels 235 named on
To start the BIND configuration program, locate and click on the icon for Domain Name System or as root run
system-config-bind
You may see a message "No BIND configuration was found. Installing the initial default configuration." Click OK

CREATE FORWARD ZONE
Ensure the entry for DNS Server is selected and click New icon and choose Zone from the pop up list.

The New Zone window appears.

1. Inside of the Origin option group:
-For class IN Internet and click OK
-For Origin Type choose Forward and click OK
-Enter the name of your domain (example.com.). Remember the trailing period. If you don't a window will appear letting you know that the period has been appended for you.

2. Inside of Zone Type
-Choose Master and click OK
3. Zone Authority Information for the zone that was just created is now displayed
-Check to make the Authoritative Name Server and the Responsible Person E-Mail Address information is correct.
-The default settings for the other items are fine. Click OK.

CREATE REVERSE ZONE
Ensure the entry for DNS Server is selected and click New icon and choose Zone from the pop up list.

The New Zone windows appears.

1. Inside of the Origin option group select:
-For Class IN Internet and click OK
-For Origin Type choose IPV4 Reverse
-Enter the first octet of your network range (i.e. the 192 in 192.168.0.x) and click Add
-Repeat the above steps for the second and third octets
2. Inside of Zone Type
-Choose Master and click OK
3. Zone Authority Information for the zone that was just created is now displayed
-Check to make the Authoritative Name Server and the Responsible Person E-Mail Address information is correct.
-The default settings for the other items are fine. Click OK.

CREATE RECORDS
Click on the arrow to expand the forward look up zone (example.com). The information contained inside of your zone is displayed below the zone name.

HOST RECORDS
The section covers how to create the most common type of record - the host record.
-Click on the New icon and choose "A IPV4"
-Enter the hostname of the systems that you are creating the record for in the Domain Name box. You do not need to include the fully qualified domain name as the domain name will be automatically appended to the hostname.
:) note: I always create record for the domain name itself and point it toward my web server. This allows users to view my website by just typing in the domain name. No "www" is needed. To do this, do not enter a hostname as described above just enter the domain name followed by a period.
-From the "Select IPv4 Prefix", select the IPv4 reverse zone that the host is going to belong to. For example, a host with IP address 192.168.0.10 would belong to the 192.168.0 prefix group. Enter the final octet in the fourth box under IPv4 Address.
-It is recommended that you generate a reverse mapping for this record. To do that, ensure that the "Create Reverse Mapping Record" box is checked.
-Click OK. Do the above steps for each host on your network that your other systems on your network will need to communicate with. Examples would be print severs, SMTP, IMAP, POP, web servers and file servers.
MX RECORDS
MX or Mail Exchange records are needed for most mail systems to function properly. The following steps will guide you through the process of setting up this record.
-Ensure the SMTP servers forward record has been entered into the DNS as described in the section HOST RECORDS
-Click on the New icon and choose "MX Mail Exchange"
-The MXMail Exchange will appear. Ensure that the domain that the mail server will be a part of is in the Domain Name box.
-Choose a priority for the mail server. This is important if you have more than one SMTP server on your network. Other mail servers will attempt to deliver mail to the mail server with the lowest priority first. If that fails, it will attempt the mail server with the next higher priority and so on.
-Enter the hostname of the SMTP server for the domain in the Mail Server Name box. You do not need to include the fully qualified domain name as the domain name will be automatically appended to the hostname.
CNAME RECORDS
CName or Canonical Names are aliases for other systems on your network. For example, you may want mail.example.com to resolve to smtp01.example.com on your network. The below steps will help you create a canonical name.
-Click on the New icon and choose "CNAME Alias"
-Enter the alias name in the Domain Name box (i.e. mail). You do not need to include the fully qualified domain name as the domain name will be automatically appended to the hostname.
-In the Canonical Name box, enter the hostname of the system you want alias to point to (i.e. smtp01)

That concludes this tutorial on how to setup and configure a basic DNS for your network. There are a lot of other options in the DNS such as zone replication to slave servers. As time permits, I include sections in this tutorial for setting other options up in the DNS.

Enjoy!

GrapeShot

I've exhusted all my resources in resolving this issue so please help...

I have a DNS server setup on a REDHAT box, everything seems to be working okay execpt the CNAME feature. The DNS server is up and running, it resolve names for both Linux and Windows without any issues.

However, the environment I work in requires Aliases and i'm not able to get it to for this DNS.

Everytime I use the Gui to add a CNAME and try to save, I get:
Save of Zone File /var/named/chroot/var/named/domainname.db failed:
dns_master_load:/var/named/chroot/var/named/domainname.db:52:host1.domainname: CNAME and other data zone domainname/IN: loading master file /var/named/chroot/var/named/domainname.db:CNAME and other data.


This is the first few lines of my zone file...anything jumping out?



$TTL 1H
@ SOA hostname. root.hostname. ( 18
3H
1H
1W
1H )
NS hostname.
IN 1H MX 0 mailserver
host1 A xxx.xx.xx.169
host2 A xxx.xx.xx.168
host3 A xxx.xx.xx.160
host4 A xxx.xx.xx.163
host5 A xxx.xx.xx.162
host6 A xxx.xx.xx.165

GrapeShot
22nd September 2007, 03:34 AM
I don't see any glaring problems with your configuration. What version of Red Hat are you running? I did notice some extra "dots" in your configuration - each of them after the host named "hostname". Also, with F7 at least, some extra columns are added in. My configuration file is posted below for you to reference.
$TTL 1H
@ SOA host1 root.host1 ( 4
3H
1H
1W
1H )
IN 1H A xxx.xxx.xxx.1
NS host1
IN 1H MX 0 host1
host1 IN 1H A xxx.xxx.xxx.1
host2 IN 1H A xxx.xxx.xxx.2
host3 IN 1H A xxx.xxx.xxx.3
host4 IN 1H A xxx.xxx.xxx.4
host5 IN 1H CNAME host1
host6 IN 1H A xxx.xxx.xxx.11
You could always add in the CNAME manually. Do you see any errors in /var/log/messages when you start/restart the DNS service?

Kumamoto, Japan Travel Photos - Bucay (Cumanda)