Ubuntu 12.04 Command Line DNS setup and installation

Status
Not open for further replies.

ebrusky

Honorable
Oct 8, 2013
19
0
10,510
Ubuntu 12.04 Command Line DNS setup and installation

Description
The following instructions will assist you in the creation of a DNS server for your Ubuntu Linux 12.04 server environment.

Pre-requisites
[_] Ubuntu 12.04
[_] Sudo level access
[_] Internet connection for downloading
[_] Workstation for testing with admin\sudo level access

Instructions
1.) Install bind9 via ‘sudo apt-get install bind9’

2.) Select ‘Y’ when prompted

3.) Now edit the following file ‘/etc/bind/named.conf.local’ and add these lines
__a. #Domain zone
__b. zone “<yourzonename>” {
__c. type master;
__d. file “/var/lib/bind/<yourzonename>.hosts”;
__e. };

4.) Now we’ll create the actual zone
__a. Sudo mkdir /etc/bind/zones
__b. sudo vi /var/lib/bind/<yourzonename>.hosts
__c. Now add the following lines
____i. $ttl 38400
____ii. <yourzonename>. IN SOA <servername>. temp.test.com (
____iii. 1348148366
____iv. 10800
____v. 3600
____vi. 604800
____vii. 38400 )
____viii. <yourzonename>.local. IN NS <servername>.
____ix. test.<yourzonename>.local. IN A 192.168.1.1

JbJefyi.png

*Formatting is important. If you have difficulties double check how you've entered the data.

5.) Now we’ll edit the options file to add a DNS forwarder
__a. sudo vi /etc/bind/named.conf.options
____i. Remove the comment characters from the forwarders sections and replace the 0.0.0.0 with the correct forwarder IP address. (Forward address will most likely be your ISP's DNS server or one of the many others available.)
____ii. :wq when complete

6.) Now make your server use what we just configured
__a. sudo vi /etc/resolve.conf
__b. nameserver <your servers IP address>
__c. :wq

Testing
1.) Test your server from your workstation, confirm that it is using the server you just configured as its DNS server (assign it statically.)

The above is meant to be an example, you will want to change the specific values to your network requirements. The "temp.test.com'' setting in your zone file is an email address which is required.
 
Status
Not open for further replies.