0

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<<- opcode: QUERY, status: NOERROR, id: 20315
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 3

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: 5e4f9d4078dbda280100000065d90bd4e2ffc3f2dc27663a (good)
;; QUESTION SECTION:
;home.twelsh.co.uk.             IN      NS

;; ANSWER SECTION:
home.twelsh.co.uk.      300     IN      NS      ns1.home.twelsh.co.uk.
home.twelsh.co.uk.      300     IN      NS      ns2.home.twelsh.co.uk.

;; ADDITIONAL SECTION:
ns1.home.twelsh.co.uk.  300     IN      A       192.168.0.86
ns2.home.twelsh.co.uk.  300     IN      A       192.168.0.88

;; Query time: 0 msec
;; SERVER: 192.168.0.86#53(192.168.0.86) (UDP)
;; WHEN: Fri Feb 23 21:19:16 UTC 2024
;; MSG SIZE  rcvd: 142

If I do the same for a host, calvin, I get the following, showing the name but no associated IP address. Can anyone tell me where I have gone wrong. I am pulling my hair out.

I have read, and reread this article but still have issues. -

twelsh@builder-box:~$ dig @192.168.0.86 A calvin

; <<>> 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
};
5
  • @GillesQuénot Running dig @192.168.0.86 A calvin fails to return an IP address. Running dig @192.168.0.86 A calvin.home.twelsh.co.uk returns the following line ;; ANSWER SECTION: calvin.home.twelsh.co.uk. 300 IN A 192.168.0.89 but I thought I could just query calvin and it would return the IP? Commented Feb 23, 2024 at 22:27
  • No problem with English. Problems with cut and paste. twelsh@builder-box:~$ dig @192.168.0.86 A calvin. ;; QUESTION SECTION: ;calvin. IN A ;; AUTHORITY SECTION: . 4461 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2024022302 1800 900 604800 86400 Commented Feb 23, 2024 at 23:28
  • Tried that previously and again now. still no joy. Commented Feb 23, 2024 at 23:53
  • id tried that previously, but tried again. Still no joy. No answer returned Commented Feb 24, 2024 at 0:08
  • First, your rDNS entries are not correct. Second, you need to ensure your /etc/resolv.conf file has the correct nameserver & search entries configured, which should be set to 192.168.0.86 & home.twelsh.co.uk. respectively at the very least. Commented Feb 24, 2024 at 13:23

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.