Recent Changes - Search:

Softwares

.

How-to-Setup-your-own-primary-and-secondary-name-servers

Main.How-to-Setup-your-own-primary-and-secondary-name-servers History

Hide minor edits - Show changes to output

June 30, 2007, at 09:14 AM by 202.56.231.116 -
Added lines 1-181:
%red%How-to-Setup-your-own-primary-and-secondary-name-servers

Simple Steps in creating your own name servers on redhat-release box.


%red%STEP 1

Requirements:

Server with additional free virtual IP address.

Make sure that you have your domain and the associated name servers registered through your registrar such as enom, networksolutions, etc. Also make sure that the name servers reolves to your server.

First we need to get the following bind packages, Which can be installed using "yum install <package_name>" command or using the command "up2date -i <packae_name>".

After the install process is complete, you can check if the packages are installed using the command below.
The below command shows that the packages are installed on the severs.

# rpm -qa|grep bind
bind-devel-9.2.1-16
bind-utils-9.2.1-16
bind-9.2.1-16
redhat-config-bind-1.9.0-13

%red%STEP 2

After the above packages are installed we need to open/edit the file /etc/named.conf and then create a entry for our primary and secondary name servers.

Let's Assume our Primary and Secondary name Servers as follows.

Primary NameServer : ns0.armia8dns.com 192.168.0.8

Secondary Name Server : ns1.armia8dns.com 192.168.0.9


%red%Now add the name servers ns0.armiadns.com and ns1.armiadns.com...

[~]# vi /etc/named.conf


zone "ns0.armia8dns.com" {
type master;
file "/var/named/ns0.armia8dns.com.db";
};

%red%STEP 3

The 3rd step is to create the db file for the above dns in /var/named/

[~]# vi /var/named/ns0.armia8dns.com.db



$ORIGIN .
$TTL 86400
ns0.armia8dns.com IN SOA ns0.armia8dns.com. root.armia8.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS ns0.armia8dns.com.
IN NS ns1.armia8dns.com.
IN A 192.168.0.8
IN MX 0 ns0.armia8.com.
$ORIGIN ns0.armia8dns.com.
localhost A 127.0.0.1

%red%STEP 3 A

Now again for ns1.armia8dns.com add the entry in /etc/named.conf as shown below

zone "ns1.armia8dns.com" {
type master;
file "/var/named/ns1.armia8dns.com.db";
};


%red%STEP 3 B

Again create a file named /var/named/ns1.armia8dns.com.db

[~]# vi /var/named/ns1.armia8dns.com.db



$ORIGIN .
$TTL 86400
ns1.armia8dns.com IN SOA ns0.armia8dns.com. root.armia8.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS ns0.armia8dns.com.
IN NS ns1.armia8dns.com.
IN A 192.168.0.9
IN MX 0 ns1.armia8.com.
$ORIGIN ns1.armia8dns.com.
localhost A 127.0.0.1


%red%STEP 4

Now we can start named on the server and see if armia8dns works fine or not, we can use the dig command or the command such as ping to test this.

#dig ns0.armia8dns.com and dig ns1.armia8dns.com


ADDING A DOMAIN TO THE DNS FILE AND TO /var/named

%red%STEP 5

The 4th step is to add a new domain "terminal.org" to the dns.

%red%STEP 6

Open the file /etc/named.conf and add the following line to the file named.conf

[~]# vi /etc/named.conf




zone "terminal.org" {
type master;
file "/var/named/terminal.org";
};

%red%STEP 7...

The 7th step is to create the db file for the above domain "terminal.org" dns in /var/named/

[~]# vi /var/named/terminal.org.db



$TTL 86400
@ IN SOA ns0.armia8dns.com. root.armia8.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

terminal.org. IN NS ns0.armia8dns.com.
terminal.org. IN NS ns1.armia8dns.com.
terminal.org. IN A 192.168.0.8
localhost.terminal.org. IN A 127.0.0.1
terminal.org. IN MX 0 terminal.org.
www IN CNAME terminal.org.
mail IN CNAME terminal.org.

%red%STEP 8

Restart the dns server and then try to check the domain terminal.org

%green%STARTING BIND SERVER

/etc/init.d/named restart

service named restart

rndc reload

%red%STEP 9

Now if you would like to add subdomain entries...do use the following entries in the file /etc/named/terminal.org.db

admin IN A 192.168.0.8
www.admin IN A 192.168.0.8
ads IN A 192.168.0.8
www.ads IN A 192.168.0.8

check to see if /etc/resolv.conf are setup correctly for DNS .

%green%Name Server not Working : Check /var/log/messages for error logs, most of the problems are resolved by checking the error log files.

Resources..http://www.isc.org/index.pl?/sw/bind/FAQ.php
Edit - History - Print - Recent Changes - Search
Page last modified on June 30, 2007, at 09:14 AM