WillyXJ / facileManager

A modular suite of web apps built with the sysadmin in mind.
www.facilemanager.com
GNU General Public License v2.0
87 stars 37 forks source link

[BUG] Reverse Zone Files (.rev) not included in zone #519

Closed twildATgmxde closed 3 years ago

twildATgmxde commented 3 years ago

fM Version : 4.0.3 fmDNS Version : 4.1.0


Editing forward/master map and checking PTR two revers maps appears on the server

If i set entry into a forward/master map with reverse map PTR button and editing the corresponding reverse map, two files for revers map existing, one with .rev and one with .hosts. Like:

db.65.168.192.in-addr.arpa.hosts db.65.168.192.in-addr.arpa.rev

Further more this both files should at least identical? But they aren't. Also I have never seen an include directive for the .rev file and loaded by the named server.

Any ideas what i doing wrong here?

Thanks in advance!

(BUG | ISSUE) Steps to reproduce: Insert Entry in Forward/Master, set PTR and save, afterwards go into the revers map and editing the map and save. Now two files for the reverse files for the same zone with different content appearing (.rev/hosts).

One more issue here is related to double declaration

F.i. name1 A 192.168.65.240 name2 A 192.168.65.240 240.65.168.192.in-addr.arpa IN PTR name1 240.65.168.192.in-addr.arpa IN PTR name2

The create PTR for the last entry in the forward/master map will not change to "update", it stays on "create". Seems it's caused by the (legal) double declaration?

My current work around is a link from .hosts to .rev on the target system.

PS: sorry for the inconvenience. But the tools are really useful and great. I will make a donate soon!

WillyXJ commented 3 years ago

I'm trying to reproduce this and am having trouble so I have two questions:

  1. What server update method do you use (ssh, http, cron, etc)?
  2. Do you see this behavior when doing a config preview on the server?
twildATgmxde commented 3 years ago

Hi, thanks for fast response:

1.) use cron update 2.) here are the content of the files:

/master/db.test.my.hosts: (Browser view) ; This file was built using fmDNS 4.1.0 on Sat, 06 Feb 2021 21:02:35 +0100 Europe/Busingen

$TTL 1d test.my. IN SOA ns.test.my. admin.test.my. ( 2021020602 ; Serial 2h ; Refresh 1h ; Retry 2w ; Expire 1d ) ; Negative caching of TTL

; Name servers test.my. IN NS test.my.

; Host addresses name1.test.my. IN A 192.168.99.1 name2.test.my. IN A 192.168.99.2 name4.test.my. IN A 192.168.99.4

/master/db.99.168.192.in-addr.arpa.hosts: (on browser view, but takes place in rev file on server) ; This file was built using fmDNS 4.1.0 on Sat, 06 Feb 2021 21:00:44 +0100 Europe/Busingen

$TTL 1d 99.168.192.in-addr.arpa. IN SOA ns.test.my. admin.test.my. ( 2021020603 ; Serial 2h ; Refresh 1h ; Retry 2w ; Expire 1d ) ; Negative caching of TTL

; Name servers 99.168.192.in-addr.arpa. IN NS ns.test.my.

; Addresses point to hosts 3.99.168.192.in-addr.arpa. IN PTR name3.test.my. 4.99.168.192.in-addr.arpa. IN PTR name4.test.my.

and still the old file on server:

db.99.168.192.in-addr.arpa.hosts (on server NOT IN BROWSER ) but the change are in rev, with no reference in zone file:!!!

$TTL 1d 99.168.192.in-addr.arpa. IN SOA ns.test.my. admin.test.my. ( 2021020600 ; Serial 2h ; Refresh 1h ; Retry 2w ; Expire 1d ) ; Negative caching of TTL

; Name servers 99.168.192.in-addr.arpa. IN NS ns.test.my.

Zone file: zone "99.168.192.in-addr.arpa" { file "/etc/named/zones/master/db.99.168.192.in-addr.arpa.hosts";

----------------

That's way I did accomplish (hopefully):

create test.my -> SOA -> NS -> A
--> inserted name1 A 192.168.99.1 name2 A 192.168.99.2 ---> db.test.my.hosts

create 99.168.192.in-addr.arpa. -> SOA -> NS ---> db.99.168.192.in-addr.arpa.hosts

set PTR in test.my name1 A 192.168.99.1 PTR name2 A 192.168.99.2 PTR

Feb 6 20:06

---> db.99.168.192.in-addr.arpa.rev  (
    ; Addresses point to hosts
    1.99.168.192.in-addr.arpa.      IN   PTR   name1.test.my.
    2.99.168.192.in-addr.arpa.      IN   PTR   name2.test.my.
Feb  6 19:51 not change anymore
---> db.99.168.192.in-addr.arpa.hosts
    only SOA and ns

zones.conf.Intern: file "/etc/named/zones/master/db.99.168.192.in-addr.arpa.hosts"

but file pointers, only SOA and ns

# but file pointers still to the old hosts file

insert PTR into 99.168.192.in-addr.arpa

only db.99.168.192.in-addr.arpa.rev was update, file pointer to hosts.

3.99.168.192.in-addr.arpa.      IN   PTR   name3.test.my.
# takes no effect on server!!
# Feb  6 20:42
# db.99.168.192.in-addr.arpa.rev ( zombie file , no ref in zone.conf.Intern )

insert A record into test.my with PTR flag

no effect, PTR Flag dosnt change to Update

# and  PTR entry takes no place in any File!
# neither rev nor hosts.

At the end there are two ref files arpa.rev and arpa.host with similar content but not really identical. Now, any further changes are only in arpa.rev file on server , but this file are never included by the zone file:

-rw-r--r-- 1 named named 531 Feb 6 21:57 db.my.test.hosts -rw-r--r-- 1 named named 332 Feb 6 19:51 db.99.168.192.in-addr.arpa.hosts <--- online this file is included -rw-r--r-- 1 named named 638 Feb 6 22:00 db.99.168.192.in-addr.arpa.rev

Tnx, regards Thomas

WillyXJ commented 3 years ago

Thanks for the extra information. The .rev file is incorrect and a result of #456. I see the bug in the code with using cron as the update method. SSH and http update methods do not have this bug. The only workaround until the next release is to change your clients to use ssh or http.

sergor75 commented 3 years ago

Good day!

We are using fmDNS v.4.1.0 on centos 7.9 and encountered a bug https://github.com/WillyXJ/facileManager/issues/519

1) When do you plan to release a new version of fmDNS? 2) Does fmDNS work on Ubuntu 20.04 + bind 9.16.1? We plan to migrate from centos.

WillyXJ commented 3 years ago

This is now fixed in fmDNS 5.0.0 and later.

WillyXJ commented 3 years ago
  1. Does fmDNS work on Ubuntu 20.04 + bind 9.16.1? We plan to migrate from centos.

Yes, fM and its modules work with Ubuntu 20.04.