[2024]Digital Global Overview Report 2024 Meltwater.pdf
Install BIND9 on Ubuntu Server 12.04 LTS
1.
Install
BIND9
on
Ubuntu
12.04
2. We’re going to setup DNS server using ISC BIND (version 9) on Ubuntu
Server 12.04 LTS.
First, update your OS:
sudo apt-get update && sudo apt-get upgrade
After that, install BIND9:
sudo apt-get install bind9
Now that BIND is installed, we’re going to edit /etc/bind/named.conf.options
and configure BIND to cache requests and forward unresolved queries.
sudo nano /etc/bind/named.conf.options
Remove the comments from the ‘forwarders’ section and add your external
DNS servers. In the below example I’m using Google’s public DNS servers
(8.8.8.8 and 8.8.4.4):
forwarders {
8.8.8.8;
8.8.4.4;
};
So now the next thing that we need to do is to create the actual zone file for
our domain (of which in this example is ‘yoursite.db‘):
sudo nano /etc/bind/named.conf.local
* Replace “yoursite.com” with your domain name.
Add a zone for our local domain like so:
zone "yoursite.com" IN {
type master;
file "/etc/bind/zones/yoursite.db";
};
Now we create the actual the zone database file for our ‘yoursite.db‘ domain:
sudo mkdir /etc/bind/zones
sudo nano /etc/bind/zones/yoursite.db
3. Now add the following content into the file (obviously replace the
hostnames/IP address with your own personal setup etc.):
;
; BIND data file for yoursite.com
;
$TTL 604800
@ IN SOA carl.ns.cloudflare.com. root.yoursite.com. (
4 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
yoursite.com. 86400 IN NS carl.ns.cloudflare.com.
yoursite.com. 86400 IN NS pat.ns.cloudflare.com.
yoursite.com. IN A 10.10.10.254
localhost. yoursite.com. IN A 127.0.0.1
yoursite.com. IN MX 10 yoursite.com.
mail IN CNAME yoursite.com.
www IN CNAME yoursite.com.
blog IN CNAME yoursite.com.
wiki IN CNAME yoursite.com.
We’re nearly there, now we simply need to restart the BIND daemon for the
changes to take effect:
sudo /etc/init.d/bind9 restart