0

enter code hereI am setting up my primary DNS server. The reverse lookup appears to work fine, it is the forward lookups that seems to be the problem.

Here are my configurations files.

/etc/default/bind9:

RESOLVCONF=no
OPTIONS="-u bind -4"

/etc/bind/named.conf.options:

acl "trusted" { 192.168.1.0; localhost; };
options {
    directory "/var/cache/bind";
    recursion yes;
    allow-recursion { trusted; };
    listen-on { 192.168.1.204; 127.0.0.1; };
    allow-transfer { none; };
    forwarders { 
        192.168.1.254;
    };
// listen-on-v6 { any; };
};

/etc/bind/named.conf.local:

zone "example.home.local" {
    type master;
    file "etc/bind/zones/db.example.home.local";
    };

zone "1.168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/zones/db.1.168.192";
    };

/etc/bind/zones/db.example.home.local:

;
; BIND data file for local loopback interface
;
$TTL    604800
@   IN  SOA ubuntuserver.example.home.local. root.example.home.local. (
                 14     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
;
;name servers - NS records
@   IN  NS  ubuntuserver.example.home.local.

;name servers - A records
ubuntuserver    IN  A   192.168.1.204

;subnet - A records
ubuntuweb   IN  A   192.168.1.208

/etc/bind/zones/db.1.168.192:

;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@   IN  SOA example.home.local. root.example.home.local. (
                 11     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
; name servers
@   IN  NS  UbuntuServer.

; PTR records
204 IN  PTR ubuntuserver.example.home.local.
208 IN  PTR ubuntuweb.example.home.local.

As mentioned earlier, the reverse lookup works fine. When I run

sudo named-checkzone 1.168.192.in-addr.arpa /etc/bind/zones/db.1.168.192

the results are ok and also when I do an nslookup from a test client it is able to successfully resolve the IP address to the name.

However, when I run

sudo named-checkzone example.home.local /etc/bind/zones/db.example.home.local

it reports back

loading from master file /etc/bind/zones/db.example.home.local failed: unknown class/type

1 Answer 1

1

You have a typo in /etc/bind/named.conf.local where you're missing a leading / from the database path:

file "etc/bind/zones/db.example.home.local";
3
  • Thank you, I knew it was probably something small that I just kept missing. I will correct that and let you know how I get on. Commented Jun 10, 2019 at 11:26
  • @DanW did that work for you? Commented Jun 26, 2019 at 14:26
  • Unfortunately I was still having problems. I ended up using dnsmasq in the end. Will come back to bind in the future but I appreciate the help greatly. Commented Jun 30, 2019 at 7:34

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.