Install Bind DNS Server on Ubuntu 13.04 12.10 Debian

Howto Install Bind DNS Server on Ubuntu 13.04 12.10 Debian


DNS Server What is



1. Install Bind DNS Server on Ubuntu / Debian

root@ubuntu:~# sudo apt-get install bind9
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
Suggested packages:
The following NEW packages will be installed:
bind9 bind9utils
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 542 kB of archives.
After this operation, 1,459 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 raring/main bind9utils amd64 1:9.9.2.dfsg.P1-2ubuntu2 [147 kB]
Get:2 raring/main bind9 amd64 1:9.9.2.dfsg.P1-2ubuntu2 [396 kB]
Fetched 542 kB in 6s (78.2 kB/s)
Preconfiguring packages …
Selecting previously unselected package bind9utils.
(Reading database … 59518 files and directories currently installed.)
Unpacking bind9utils (from …/bind9utils_1%3a9.9.2.dfsg.P1-2ubuntu2_amd64.deb) …
Selecting previously unselected package bind9.
Unpacking bind9 (from …/bind9_1%3a9.9.2.dfsg.P1-2ubuntu2_amd64.deb) …
Processing triggers for man-db …
Processing triggers for ufw …
Processing triggers for ureadahead …
Setting up bind9utils (1:9.9.2.dfsg.P1-2ubuntu2) …
Setting up bind9 (1:9.9.2.dfsg.P1-2ubuntu2) …
Adding group `bind’ (GID 115) …
Adding system user `bind’ (UID 107) …
Adding new user `bind’ (UID 107) with group `bind’ …
Not creating home directory `/var/cache/bind’.
wrote key file “/etc/bind/rndc.key”
* Starting domain name service… bind9 [ OK ]
Processing triggers for ufw …
Processing triggers for ureadahead …

2.  Configure named configuration with domain ithelpblog.local and Reverse IP range

root@ubuntu:~# cat /etc/bind/named.conf.local
// Do any local configuration here
//// Consider adding the 1918 zones here, if they are not used in your
// organization
//include “/etc/bind/zones.rfc1918”;# Our domain zone
zone “ithelpblog.local” {
type master;
file “/etc/bind/zones/ithelpblog.local.db”;
# For reverse DNS
zone “” {
type master;
file “/etc/bind/zones/”;

3. Create DNS forwarder on Bind DNS Server

root@ubuntu:~# cat /etc/bind/named.conf.options
options {
directory “/var/cache/bind”;// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0’s placeholder.
forwarders {;
//====================================================================== ==
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See
//====================================================================== ==
dnssec-validation auto;auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };

4. Create and configure zone

root@ubuntu:~# sudo mkdir /etc/bind/zones
root@ubuntu:~# sudo nano /etc/bind/zones/ithelpblog.local.db
; BIND zone definition file for ithelpblog.local
ithelpblog.local. IN SOA ns1.ithelpblog.local. admin.ithelpblog.local. (
2011072601; Serial

; Nameserver and mailserver (replace with your own hostnames):
ithelpblog.local. IN NS ns1.ithelpblog.local.
ithelpblog.local IN MX 10 mail.ithelpblog.local.
; IP addresses of local hosts (replace the lines with your own hosts):
win IN A
ns1 IN A
www IN A
ubuntu IN A

Create reverse zone

root@ubuntu:~# cat /etc/bind/zones/
@ IN SOA ns.ithelpblog.local. admin.ithelpblog.local. (
IN NS ns.ithelpblog.local.
254 IN PTR gw.ithelpblog.local.
151 IN PTR ubuntu.ithelpblog.local.
1 IN PTR win.ithelpblog.local.


5.  Test DNS Server by dig command

root@ubuntu:~# dig win.ithelpblog.local
; <<>> DiG 9.9.2-P1 <<>> win.ithelpblog.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57733
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;win.ithelpblog.local. IN A;; ANSWER SECTION:
win.ithelpblog.local. 38400 IN A;; AUTHORITY SECTION:
ithelpblog.local. 38400 IN NS ns1.ithelpblog.local.;; ADDITIONAL SECTION:
ns1.ithelpblog.local. 38400 IN A;; Query time: 3 msec
;; WHEN: Mon Jul 15 05:34:48 2013
;; MSG SIZE rcvd: 99

That’s all. Thanks for using



Leave a reply

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=""> <s> <strike> <strong>