Restoring a subdomain from backup crashes named.service (DNS BIND) with missing NS record

Restoring subdomain.example.org deletes the NS record in example.org when restoring from a full backup. The subdomain is being created by the Virtualmin restore process (named.service crashes when Virtualmin restarts it).

Running a check on the BIND configuration reveals:

The following errors were found in the BIND configuration file /etc/named.conf or referenced zone files ..

    zone example.org/IN: has no NS records
    zone example.org/IN: not loaded due to errors.
    _default/example.org/IN: bad zone

<-  Return to zone list

The NS records was present and the parent domain was working fine, prior to restoring the subdomain. This has happened every time I have restored a subdomain.

The fix is to go into the parent virtual server, add back the NS record, and start the named.service.

Backup from CentOS 6.9, Virtualmin full backup with all options selected, restoring to CentOS 7.4

Status: 
Closed (fixed)

Comments

That sure sounds like a bug!

What was the name of the NS record that got deleted - was it for example.org , or subdomain.example.org ?

I'm having the same issue. It appears to only effect servers that have sub-domains.

It's also worth nothing that the template on the parent domain has Add sub-domain DNS records to parent domain? Yes. The template for the sub-domain is set to Add sub-domain DNS records to parent domain? From default settings

In my case all NS records were missing from the domain. For example, if the domain is domain.tld and the subdomain is subdomain.domain.tld, a zone file is created for domain.tld and it doesn't contain any NS records.

Looking at the code, I can't see how NS records that are for the parent domain would be removed. An NS record for the sub-domain (if it exists) will be deleted though.

bperet's picture
Submitted by bperet on Sun, 02/18/2018 - 20:26

What was the name of the NS record that got deleted - was it for example.org , or subdomain.example.org ?

The parent NS record gets deleted when restoring a subdomain. example.org is just gone, after restoring subdomain.example.org.

Ok, I see the bug that causes this - it will be fixed in the next Virtualmin release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.