Install BIND9 DNS in ubuntu 20.04 server steps
1) lsb_release -a
2) vi /etc/hosts
127.0.0.1 localhost
192.168.32.50 dc.faceitnet.com.au dc
3) vi /etc/hostname
DC
4) vi /etc/cloud/cloud.cfg
protect_hostname: true
5) reboot
6) vi /etc/resolv.conf
nameserver 192.168.32.50
nameserver 127.0.0.53
options edns0
Search faceitnet.com.au
7) apt-get install bind9 bind9utils bind9-doc -y
cd /etc/mount/
cp named.conf.local named.conf.local.back
cp db.local db.fwd.faceitnet.com.au
cp db.local db.rev.faceitnet.com.au
mkdir /etc/mount/regions
mv db.fwd.faceitnet.com.au zones
mv db.rev.faceitnet.com.au zones
8) vi named.conf.local
Zone “faceitnet.com.au” IN {
type master;
file “/etc/bind/zones/db.fwd.faceitnet.com.au”;
allow update {none;};
};
Zone “168.192.in-addr.arpa” IN {
type master;
file “/etc/bind/zones/db.rev.faceitnet.com.au”;
allow update {none;};
};
9) vi named.conf.options
acl “Trusted” {
192.168.32.50; # Name Server
};
Options {
directory “/var/cache/mount”;
// If you have a firewall between you and the nameservers you want
// so to speak, you may need to fix the firewall to allow multiple permissions.
// ports to talk. See https://ift.tt/3CNBZmd
// If your ISP has provided one or more IP addresses for stable use
// nameservers, you probably want to use them as forwarders.
// Uncomment the block below and add the changed addresses
// placeholder of all-0.
recursion yes; # enables recursive queries
allow-recursion { Trusted; }; # allows recursive queries from “trusted” clients
listen { 192.168.32.50; }; # ns1 private IP address – listen only on private network
permission-transfer {none; }; # disable zone transfers by default
shippers {
8.8.8.8;
8.8.4.4;
};
// forwarders {
// 0.0.0.0;
// };
//================================================== == ========================
// If BIND logs error messages for the root key that has expired,
// you will need to update your keys. See https://ift.tt/3nJ0r3H
//================================================== == ========================
dnssec authentication automatic;
auth-nxdomain no; # Complies with RFC1035
listen-v6 { any; };
};
10) cd regions
vi db.fwd.faceitnet.com.au
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA at dc.faceitnet.com.au. root.dc.faceitnet.com.au. (
6
604800
86400
2419200
604800)
;
@NS on localhost.
@ 127.0.0.1
@ YYYY ::1
;Name Server Information
NS at dc.faceitnet.com.au.
;Name Server A records
dc.faceitnet.com.au. AT 192.168.32.50
11) Now open the reverse file db.rev.faceitnet.com.au
vi db.rev.faceitnet.com.au
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA at dc.faceitnet.com.au. root.dc.faceitnet.com.au. (
5
604800
86400
2419200
604800)
;
@NS on localhost.
@ 127.0.0.1
@ YYYY ::1
;Name Server Information
NS at dc.faceitnet.com.au.
;ip PTR records from the last two parts
32.50 PTR at dc.faceitnet.com.au.
12) root@ns1:/etc/bind/zones# service bind9 reboot
13) root@ns1:/etc/bind/zones# service bind9 status
root@ns1:/etc/bind/zones# name-checkzone 168.192.in-addr.arpa db.fwd.faceitnet.com.au
root@ns1:/etc/bind/zones# name-checkzone 168.192.in-addr.arpa db.rev.faceitnet.com.au