Changing NS1/NS2 via User Settings causes domain with double dot

Version 1.501


When going to: CMD_MODIFY_USER?user=bob and changing the ns1/ns2 values, it's possible that DA creates a broken zone. With the named-checkzone enabled (which it is by default), it will catch the error, but prevents saving the change. Error would look like this: ------------------------------------------------------------------------------------------ Unable to change NameServers: Cannot write zone for Unable to save dns zone: named-checkzone returned:loading "" from "/var/named/" class "IN" dns_master_load: /var/named/ empty label zone loading from master file /var/named/ failed: empty label zone not loaded due to errors. ------------------------------------------------------------------------------------------ with the following details from a zone: 14400 IN NS 14400 IN NS 14400 IN NS 14400 IN NS 14400 IN NS ------------------------------------------------------------------------------------------ Here are the steps how to replicate the issue: 1. Create an user or use existing account in Directadmin, for example: user: bob domain: nameservers: and 2. Change Name Servers for a domain of the user at admin or user level through DNS editor. change: and to: and 3. As admin or reseller change NS1 and NS2 in user's details: change: and to: and Click "Save" and see the error. ------------------------------------------------------------- Bug was caused by how DA "extended" the to add the dot inside the container class. But because there were already multiple values with the same entry, it causes a double dot. Solution was to create the string ahead of time before loading it into the container, and not using the string extend method to add the dot.

Interested to try DirectAdmin? Get a 30-day Free Trial!