I have installed BIND9 on my Ubuntu 22.04 LTS server as my Primary nameserver for the domain home.twelsh.co.uk. It was installed via apt and the config files were hand rolled with guidance from a Digital Ocean how-to
When I execute a dig request on a client PC, for name servers I get a correct answer
twelsh@builder-box:~$ dig @192.168.0.86 NS home.twelsh.co.uk
; > DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu > @192.168.0.86 NS home.twelsh.co.uk
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER> DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu > @192.168.0.86 A calvin
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 7947
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: 751c6a8a04abd91b0100000065d90ad04417a14eccdffc7f (good)
;; QUESTION SECTION:
;calvin. IN A
;; AUTHORITY SECTION:
. 10800 IN SOA a.root-servers.net. nstld.verisign-
grs.com. 2024022301 1800 900 604800 86400
;; Query time: 32 msec
;; SERVER: 192.168.0.86#53(192.168.0.86) (UDP)
;; WHEN: Fri Feb 23 21:14:56 UTC 2024
;; MSG SIZE rcvd: 138
As far as I am aware my zone file is fine
twelsh@ns1:~$ sudo named-checkzone home.twelsh.co.uk
/etc/bind/zones/db.home.twelsh.co.uk
zone home.twelsh.co.uk/IN: loaded serial 11
OK
and my reverse lookup
twelsh@ns1:~$ sudo named-checkzone 0.168.192.in-addr.arpa /etc/bind/zones/db.192.168.0
zone 0.168.192.in-addr.arpa/IN: loaded serial 10
OK
Here are my Zone and reverse lookup files
/etc/bind/zones/db.home.twelsh.co.uk
;; Optimized BIND9 Forward Zone File
$ORIGIN home.twelsh.co.uk.
$TTL 5m
@ IN SOA ns1.home.twelsh.co.uk root.home.twelsh.co.uk. (
11 ; Serial
7d ; Refresh
1d ; Retry
28d ; Expire
7d ) ; Minimum TTL
IN NS ns1.home.twelsh.co.uk.
IN NS ns2.home.twelsh.co.uk.
n8n IN A 192.168.0.79
builder-box IN A 192.168.0.82
dev-server IN A 192.168.0.83
staging-server IN A 192.168.0.84
ns1 IN A 192.168.0.86
ns2 IN A 192.168.0.88
calvin IN A 192.168.0.89
Reverse zone file
$ORIGIN 0.168.192.in-addr.arpa.
$TTL 5m
@ IN SOA home.twelsh.co.uk. root.home.twelsh.co.uk. (
10 ; serial number incrementation example here
7d ; refresh interval
1d ; retry interval
28d ; expiry time
7d ) ; minimum cache lifetime
IN NS ns1.home.
IN NS ns2.home.
86 IN PTR ns1.home.
88 IN PTR ns2.home.
79 IN PTR n8n.home.
82 IN PTR builder-box.home.
83 IN PTR dev-server.home.
84 IN PTR staging-server.home.
86 IN PTR ns1.home.
88 IN PTR ns2.home.
89 IN PTR calvin.home.
/etc/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";
zone "home.twelsh.co.uk" {
type master;
file "/etc/bind/zones/db.home.twelsh.co.uk"; # zone file path
allow-transfer {192.168.0.88; }; # ns2 private IP address - secondary
};
zone "0.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/db.192.168.0.0"; # 192.168.0.0/24 subnet
allow-transfer { 192.168.0.88; }; # ns2 private IP address - secondary
};
Asked by twelsh37
(101 rep)
Feb 23, 2024, 10:08 PM