TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
4.27k stars 418 forks source link

[BUG] Dynamic updates to secondary zones #695

Closed micush closed 1 year ago

micush commented 1 year ago

Hi,

Please disable the ability to allow record creation, either manually or dynamically, to secondary zones.

My primary server for the zone currently returns this correctly:

dig +short pve12.cu.local @192.168.2.5
192.168.5.96

My secondary server for the zone zone currently returns this:

dig +short pve12.cu.local @192.168.2.15
192.168.5.96
192.168.5.96
192.168.5.96
192.168.5.96
192.168.5.96
192.168.5.96
192.168.5.96
192.168.5.96
192.168.5.96
192.168.5.96
192.168.5.96
192.168.5.96

And while this may demonstrate a bug in my code that I've written to register DNS updates, it certainly demonstrates a bug in TDNS's code for registration into secondary zones.

Please do not allow dynamic updates to secondary zones. The secondary zone should forward the update request to the primary zone and the primary zone should send a notify to all secondaries to update their zones.

ShreyasZare commented 1 year ago

Thanks for the reporting this bug.

The dynamic updates feature does not update the secondary zone. In fact, there is no code to update a secondary zone directly from either HTTP API or dynamic updates. When you use secondary server's IP address for dynamic updates, it just forwards the request to the primary server.

The problem here is that when adding the records in the primary zone, there is de-duplication being done but when recording the changes, all the records are getting added. This record change is what is used for incremental zone transfer and the secondary zone gets multiple records added. If you just click on Resync option in the secondary zone, it will do a full zone transfer and the duplicate records will go away.

Will get this bug fixed in the upcoming update.

Edit: This seems to be affecting only subdomain names and works well for records at zone level.

micush commented 1 year ago

Hi. Thanks for the info. For now I've removed the secondary zones and put in selective forwarders until the bug is fixed. Will try again once corrected. Thanks much.

ShreyasZare commented 1 year ago

Technitium DNS Server v11.4 is now available that fixes this issue. Do update and let me know your feedback.

micush commented 1 year ago

Seems better. Thanks for the quick turnaround. Much appreciated.