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

Version 1.501

Bugfix
Finished

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 domain.com: Unable to save dns zone: named-checkzone returned:loading "domain.com" from "/var/named/domain.com.db.temp" class "IN" dns_master_load: /var/named/domain.com.db.temp:20: empty label zone domain.com/IN: loading from master file /var/named/domain.com.db.temp failed: empty label zone domain.com/IN: not loaded due to errors. ------------------------------------------------------------------------------------------ with the following details from a zone: domain.com 14400 IN NS ns1.nameserver.net. domain.com.. 14400 IN NS ns1.nameserver.net. domain.com. 14400 IN NS ns2.nameserver.net. domain.com. 14400 IN NS ns2.nameserver.net. domain.com. 14400 IN NS ns3.nameserver.net. ------------------------------------------------------------------------------------------ Here are the steps how to replicate the issue: 1. Create an user or use existing account in Directadmin, for example: user: bob domain: domain.com nameservers: ns1.nameserver.net and ns2.nameserver.net 2. Change Name Servers for a domain of the user at admin or user level through DNS editor. change: ns1.nameserver.net and ns2.nameserver.net to: ns1.domain.com and ns2.domain.com 3. As admin or reseller change NS1 and NS2 in user's details: change: ns1.nameserver.net and ns2.nameserver.net to: ns1.domain.com and ns2.domain.com Click "Save" and see the error. ------------------------------------------------------------- Bug was caused by how DA "extended" the domain.com 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 domain.com. 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!