How to setup name server for domain called rg4.net.


—————————————-
Step # 1: Install BIND
—————————————-
First you need to install BIND server.
Code:
$ sudo apt-get install bind9

—————————————-
Step # 2: Define rg4.net domain:
—————————————-
You need to add rg4.net domain to bind configuration file /etc/bind/named.conf.local
Open this file and append following text (zone and reverse zone for rg4.net):
Code:

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

Add rg4.net zone:
Code:

zone "rg4.net" {type master;file "/etc/bind/zones/rg4.net.zone";};

zone “72.16.172.in-addr.arpa” {
type master;
file “/etc/bind/zones/rev.72.16.172.in-addr.arpa”;
};

Save the file.

—————————————-
Step # 3: Create a /etc/bind/zones/ directory:
————————–
Code:
$ sudo mkdir /etc/bind/zones

—————————————-
Step # 4: Create a zone file for rg4.net domain:
————————–
Now create a zone file /etc/bind/zones/rg4.net.zone
Code:

$ sudo vi /etc/bind/zones/rg4.net.zone

Append following text:
Code:

rg4.net. IN      SOA     ns1.rg4.net. admin.rg4.net. (200607180128800360060480038400 )rg4.net. IN      NS      ns1.rg4.net.rg4.net. IN      MX     10 proto.rg4.net.

www           IN      A       172.16.72.229
ns1           IN      A       172.16.72.229
proto         IN      A       172.16.72.229

Create the reverse zone file:
Code:

$ sudo vi /etc/bind/zones/rev.72.16.172.in-addr.arpa

Append following text
Code:

@ IN SOA ns1.rg4.net. admin.rg4.net. (2006071801; serial28800; refresh, seconds604800; retry, seconds604800; expire, seconds86400 ); minimum, seconds

IN  NS ns1.foot.com.

2                  IN      PTR    rg4.net

Save the file and restart the BIND server:
Code:

$ sudo /etc/init.d/bind9 restart

Test it:
Code:

$ nslookup rg4.net

Server: 172.16.72.229
Address: 172.16.72.229#53

Name: rg4.net
Address: 172.16.72.229

Enjoy!

Further reading:
Linux BIND – DNS HOWTO: http://www.tldp.org/HOWTO/DNS-HOWTO.html

Leave a comment

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