DNS Server setup using Bind DNS on Ubuntu Server
avatar

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 per-configured Bind, so we will edit another file:

sudo vi /etc/bind/named.conf.local

Add  this code there

zone “example.com” {
type master;
file “/etc/bind/db.example.com”;
};

Now, let’s add the zone definition files (replace example.com with your domain name so make a zone directory in /etc/bind/

sudo mkdir /etc/bind/zones

Add the zone definition files

sudo vi /etc/bind/zones/example.com.db

Add this code there

;
; BIND data file for local loop-back interface
;
$TTL    3600
@    IN    SOA    example.com. admin.example.com. (
11
604800
86400
2419200
604800 )
;
@       IN      NS      ns1.example.com.
@       IN      A       192.168.0.1
ns1     IN      A       192.168.0.1
ns2     IN      A       192.168.0.1
www     IN      A       192.168.0.1

Save it and Restart bind Server :

sudo /etc/init.d/bind9 restart

Now Our name server is ready as
ns1.example.com
ns2.example.com

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

Now its Done.

Enhanced by Zemanta
Social Share Toolbar
This entry was posted in Development and tagged , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>