0

BIND9 reverse lookup failing for just one zone all other are working fine. I am setting up an internal DNS server with below config. I have added reverse files for /8 networks.

zone "test.com" {
    type master;
    file "/etc/bind/zones/db.test.com"; # zone file path
};

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

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

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

All the zones are working fine except "172.in-addr.arpa" . I tried using the same file as db.10 but no luck and keep getting an error that file does not exist.

; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ubuntu1.cgi.com. admin.cgi.com. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL

; name servers - NS records
      IN      NS      ubuntu1.cgi.com.

; PTR Records

; 172.0.0.0    - A records
16.16.16                        IN      PTR             host4
19.253.25                       IN      PTR             host5
TheCompWiz
  • 7,409
  • 17
  • 23
Aman
  • 1
  • 2
  • exact error ** server can't find 90.65.89.172.in-addr.arpa: NXDOMAIN – Aman Apr 09 '18 at 17:04
  • 2
    I seriously doubt the reverse-zone for 172 is correct, as you shouldn't be trying to do a reverse-zone for 172.0.0.0/8. the RFC only identifies the private network as 172.16.0.0/12... That being said, 172.89.65.90 is an actual public IP... and since you're trying to be the resolver for it, it looks like you don't have an entry in your db. – TheCompWiz Apr 09 '18 at 17:14
  • @TheCompWiz - First of all thanks for your reply. Secondly, I am not sure if 172.0.0.0/8 reverse lookup is correct or not. But this entry is present in the file. ** server can't find 16.16.16.172.in-addr.arpa: NXDOMAIN. I just want to create a repository for all the IPs that I have, does not matter public or private. – Aman Apr 09 '18 at 17:22
  • can you paste the db? perhaps it is not formatted properly. (feel free to censor as needed) – TheCompWiz Apr 09 '18 at 17:27
  • $TTL 604800 @ IN SOA ubuntu1.cgi.com. admin.cgi.com. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; name servers - NS records IN NS ubuntu1.cgi.com. ; PTR Records ; 172.0.0.0 - A records 16.16.16 IN PTR host4 19.253.25 IN PTR host5 – Aman Apr 09 '18 at 18:02
  • I tried using the same file as db.138 and db.10 to eliminate any syntax errors, but that did not help – Aman Apr 09 '18 at 18:03
  • can you put that in the question above to keep formatting? ... hard to read in comments. – TheCompWiz Apr 09 '18 at 18:04
  • just updated it, but syntax still looks bad after editing. when I paste and view the format it looks good but as soon as I save it it screws it up – Aman Apr 09 '18 at 18:08
  • Restart bind, and look at your `/var/log/daemon.log`. Bind is usually pretty verbose about errors, and which line they are on. If you have the exact error, it would be useful if you updated your question with that information. – Zoredache Apr 09 '18 at 18:12
  • Apr 9 14:08:04 Ubuntu-1 named[1692]: automatic empty zone: 16.172.IN-ADDR.ARPA – Aman Apr 09 '18 at 18:17
  • 1
    For the PTR records... you should use fqdn... ending with a "." or it will try to point to a record in the current zone... which wouldn't make sense. i.e. 19.253.25 IN PTR host5.test.com. – TheCompWiz Apr 09 '18 at 18:25
  • I tried that but still no go, same error – Aman Apr 09 '18 at 18:35
  • @Aman what error is actually posted when you restart `bind` - it can be found in `/var/log/messages` usually. You reverse zone file looks incorrect but it may just be masking something else. – user3788685 Jun 03 '18 at 11:59

0 Answers0