Friends

Sunday, January 23, 2011

7 Easy Steps Installation DNS server in Ubuntu Jaunty

DNS (Domain Name Service) server is a server that translate an IP address into a name that will be easy to remember or do the opposite way. The administrative job is done in Server side. For client side just set the machine to connect the DNS server.
Before we start, I assume that you are connected to Internet already. For, text editor, you can use any program that you are familiar with. In this sample, I use vim.
The installation is as easy as below:
Step 1. Install the bind9
Open Linux Terminal (Applications>Accessories>Terminal), type: sudo apt-get install bind9

Installation finished.


Step 2. Edit file /etc/bind/named.conf
Edit file /etc/bind/named.conf, at Linux Terminal type: $sudo vim /etc/bind/named.conf and add the codes below:

—————————————————-
include “/etc/bind/named.conf.options”;

zone “1.168.192.in-addr.arpa” {
type master;
file “/etc/bind/ip.db”;
};
zone “myserver.loc” {
type master;
file “/etc/bind/www.db”;
};
—————————————————-



Step 3. Edit file /etc/bind/ip.db
Edit file /etc/bind/named.conf, at Linux Terminal type: $sudo vim /etc/bind/ip.db and add the codes below:
—————————————————-
$TTL 86400

@ IN SOA ns.myserver.loc. root.myserver.loc. (
2006081201
8H
2H
1W
1D )
@ IN NS ns.myserver.loc.

@ IN MX 10 ns.myserver.loc.

1 IN PTR ns.myserver.loc.

1 IN PTR www.myserver.loc.
1 IN PTR mail.myserver.loc.
—————————————————-



Step 4. Edit file /etc/bind/www.db
Edit file /etc/bind/www.db, from Linux Terminal type: $sudo vim /etc/bind.www.db and add the codes below:
—————————————————-
$TTL 86400

@ IN SOA ns.myserver.loc. root.myserver.loc. (
2006081201
8H
2H
1W
1D )
@ IN NS ns.mymyserver.loc.
@ IN MX 10 ns.myserver.loc.
ns IN A 192.168.1.5
www IN A 192.168.1.5
mail IN A 192.168.1.5
—————————————————-


Step 5. Edit file /etc/resolv.conf
Edit file /etc/resolv.conf, from Linux Terminal type: $sudo vim /etc/resolv.conf and add the codes below:
—————————————————-
search myserver.loc

nameserver 192.168.1.5
—————————————————-



Step 6. Restart the DNS server
From Linux Terminal type: $sudo /etc/init.d/bind9 restart

Step 7. Test the result.
From Linux Terminal type: $ping www.myserver.loc
You may find this error because you haven’t set your ip address yet. Just type: $sudo ifconfig eth0 192.168.1.5 netmask 255.255.255.0

Test it again. Now, it works.

Now, test with ‘dig’ to get information about DNS Name server.
Most DNS administrators use ‘dig’ to troubleshoot DNS problems because it’s easy to use and very flexible.
From Linux terminal, type: $dig www.myserver.loc

Check, the dns mail server name.

Done.

0 comments:

Post a Comment

#
### ###