Home > DIY, networking, ubuntu > Quick DNS (bind9) setup for ubuntu dapper server

Quick DNS (bind9) setup for ubuntu dapper server

Setting up a DNS server in Ubuntu:

1. Type in sudo su to get get root privileges for the session
2. Type in apt-get install bind9 to install the BIND name server.
3. There is no need to edit the main configuration, so leave that.
4. Edit the “local” conf file: nano /etc/bind/named.conf.local.
5. Add the following lines to that file, which will define our domain names for the virtual hosting:
zone “” {
type master;
file “/etc/bind/zones/example.com.zone”;
};
zone “1.0.10.in-addr.arpa” {
type master;
file “/etc/bind/zones/1.0.10.in-addr.arpa.zone”;
};
6. Save and close the file. (Ctrl-X, Y)
7. Edit the options file: nano /etc/bind/named.conf.options
8. Uncomment the “forward” lines, and replace the address there with the IP address of an upstream DNS server. The easiest way to get that is to connect to the internet, and then take the top IP address from your resolv.conf file.
forwarders {
x.x.x.x; # replace with your upstream DNS server (I used 10.0.1.1 since my router is a forwarder)
};
9. Now we need to create our zone files. Type mkdir /etc/bind/zones.
10. Create and edit the forward zone file. Type nano /etc/bind/zones/lan.zone and then write this in it:
;
; BIND data file for “example.com” network
;
$TTL 604800
@ IN SOA example.com. admin.example.com. (
101 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ; Negative Cache TTL
)
;
IN NS ns
;
ns IN A 10.0.1.3
server IN A 10.0.1.100
11. Create and edit the reverse zone file. Type nano /etc/bind/zones/1.0.10.in-addr.arpa.zone and then write this in it:
;
; BIND reverse data file for “lan” network
;
$TTL 604800
@ IN SOA lan. root.server.lan. (
102 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ; Negative Cache TTL
)
;
IN NS ns
3 IN PTR ns
100 IN PTR server
12. Now restart bind by typing nano /etc/init.d/bind9 restart.

Adapted from: http://blog.saturnlaboratories.co.za/2007/01/01/howto-ubuntu-home-lan-server.html

Advertisements
Categories: DIY, networking, ubuntu
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: