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 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. (
604800 )
@       IN      NS      ns1.example.com.
@       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 our case

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>