0

I figure it out about reverse zone, so I already config my local DNS with this simple config:

1. named.conf.options

acl internal {
        192.168.1.0/24; // data
        192.168.2.0/24; // data
        192.168.3.0/24; // data
        192.168.4.0/24; // data
        192.168.5.0/24; // data
        192.168.6.0/24; // data
        192.168.40.0/24; // pabx
        192.168.60.0/24; // tv
        192.168.33.0/24; // hotspot
        192.168.35.0/24; // hotspot
        localhost;
        localnets;
};

options {
        directory "/var/cache/bind";

        forwarders {
                8.8.8.8;
                8.8.4.4;
        };

        //forward only;
        recursion yes;

        allow-query { internal; };
        allow-query-cache { internal; };
        allow-recursion { internal; };

        empty-zones-enable no;

        dnssec-validation auto;

        listen-on port 53 { localhost; 192.168.6.201; };
        listen-on-v6 port 53 { ::1; };
};

2. named.conf.local

zone "melinda.local" IN {
        type master;
        file "/etc/bind/zones/db.melinda";
        //allow-transfer { none; };
        //also-notify { none; };
};

zone "168.192.in-addr.arpa" IN {
        type master;
        file "/etc/bind/zones/db.192";
        //allow-transfer { none; };
        //also-notify { none; };
};

3. db.melinda

$TTL    604800
@       IN      SOA     srv.melinda.local. root.melinda.local. (
                        2022030901      ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.melinda.local.
@       IN      A       192.168.6.201
@       IN      MX 10   mail.melinda.local.

; defined
ns      IN      A       192.168.6.201
mail    IN      A       192.168.6.201

4. db.192

@       IN      SOA     srv.melinda.local. root.melinda.local. (
                        2022030901      ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      srv.melinda.local.
1.0.0   IN      PTR     srv.melinda.local.

; defined
6.201   IN      PTR     srv.melinda.local.
6.201   IN      PTR     mail.melinda.local.

And this is my hostname /etc/hostname, /etc/hosts, /etc/resolv.conf

$ cat /etc/hostname
srv

$ cat /etc/hosts
127.0.0.1       localhost.localdomain localhost
192.168.6.201   srv.melinda.local srv

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

$ cat /etc/resolv.conf
nameserver 192.168.6.201
nameserver 127.0.0.53
search srv.melinda.local

So when I debug my DNS config, with in named.conf.options file I set empty-zones-enable to no here's the result when using nslookup

$ nslookup
> melinda.local
Server:         192.168.6.201
Address:        192.168.6.201#53

Name:   melinda.local
Address: 192.168.6.201
> 192.168.6.201
201.6.168.192.in-addr.arpa      name = mail.melinda.local.
201.6.168.192.in-addr.arpa      name = srv.melinda.local.
>exit

But when I change empty-zones-enable into comment (or default yes), here's what I get

$ nslookup
> melinda.local
Server:         192.168.6.201
Address:        192.168.6.201#53

Name:   melinda.local
Address: 192.168.6.201
> 192.168.6.201
** server can't find 201.6.168.192.in-addr.arpa: NXDOMAIN
> exit

Maybe this is useless question but sorry I'm new to config DNS, so I want to know the different when I set empty-zones-enable to no and yes. Is this important or necessery using resolver for local DNS?

  • Two tangent points: 1) you don't need really reverse zones for anything, so besides learning there is no need to create all of that and 2) don't use `local` as a local TLD as this is reserved for multicast DNS. – Patrick Mevzek Mar 09 '22 at 14:39
  • Should it not be 201.6 instead of 6.201 for your PTR records? – Tommiie Mar 10 '22 at 14:22

0 Answers0