Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 19th August 2007, 12:13 AM
GrapeShot Offline
Registered User
 
Join Date: Jul 2007
Location: Virginia
Posts: 252
Basic DNS How-To

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
Code:
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
Code:
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
Reply With Quote
  #2  
Old 19th August 2007, 12:24 AM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,300
Sweet - thanks sincerely.
Reply With Quote
  #3  
Old 19th August 2007, 03:39 AM
kenneth_phough Offline
Registered User
 
Join Date: Aug 2007
Location: Williamstown, MA; Yokohama, Japan
Age: 23
Posts: 7
Thanks! This helped me alot
Regards,
Kenneth
__________________
Fedora Core 7
Intel Core 2 Duo
Gigabyte 945GZM-S2 Motherboard
1GB DDR 533 RAM
ATI Radeon X1550
SeaGate 160GB IDE HDD
DVD-RW+
Reply With Quote
  #4  
Old 15th September 2007, 04:13 PM
vtstarin Offline
Registered User
 
Join Date: Dec 2006
Posts: 1
thanx..lot..
Reply With Quote
  #5  
Old 21st September 2007, 06:15 PM
benso37 Offline
Registered User
 
Join Date: Feb 2005
Posts: 98
CNAME bit doesn't work..

Quote:
Originally Posted by GrapeShot
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
Code:
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
Code:
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:
Code:
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?



Code:
$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
Reply With Quote
  #6  
Old 22nd September 2007, 02:34 AM
GrapeShot Offline
Registered User
 
Join Date: Jul 2007
Location: Virginia
Posts: 252
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.
Code:
$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?
Reply With Quote
Reply

Tags
basic, dns, howto

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic metatron Programming & Packaging 8 21st January 2009 07:41 PM
Basic gpg help Ullrich Using Fedora 21 11th April 2007 11:41 AM
how to run basic.sdk? shams Using Fedora 3 10th August 2006 09:30 AM
Basic Help haroldjclements Using Fedora 8 14th June 2006 08:57 PM
Basic Mattio Wibble 15 11th July 2005 12:58 AM


Current GMT-time: 14:18 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat