Friday, October 14, 2011

DNS Server setup using Bind DNS on Ubuntu Server

To Setup Bind server we need to install Bind Package using
sudo apt-get install bind9

Configure the main Bind files. Usually, if you install Bind from the source code, you will have to edit the file named.conf. However, Ubuntu provides you with a pre-configured Bind, so we will edit another file:
sudo vi /etc/bind/named.conf.local

Add  this code there
zone "" {
type master;
file "/etc/bind/";

Now, let's add the zone definition files (replace with your domain name so create a zone definition file as
sudo vi /etc/bind/

Add this code there
; BIND data file for local loopback interface
$TTL    3600
@    IN    SOA (
604800 )
@       IN      NS
@       IN      A
ns1     IN      A
ns2     IN      A
www     IN      A

Save it and Restart bind Server :
sudo /etc/init.d/bind9 restart

Now Our name server is ready as

if it asks for IP address just provide the IP address of your server in oue case

Now its Done.