Server Configuration -> DNS Records -> checkmark a mx record + click "Delete Selected Records" can lead to empty zone file

I wanted to delete an old secondary MX server on a domain that has DNS master server separate from the webserver.

To do that I went to:

Server Configuration -> DNS Records

At the top there was this warning:

Warning - errors were found in this domain's DNS records : The DNS record resolves to the IP address instead of the virtual server's IP

(domain name and IP addresses changed above for privacy reasons)

I checkmarked the mx record + clicked "Delete Selected Records"

The page refreshed but with an empty list (!), and an empty zone file in /var/lib/bind/ (!)

Fortunately a second bug of that screen (which is that the zone is not applied on delete selected record) allowed me to get back quickly the latest zone file for that domain from a secondary dns server. Additionally no downtime, so no harm. Just a bit of adrenaline. And rembering to never use that screen...

Just thought that reporting that bug might be helpful as in other circumstances it could lead to loss of data and website.



That's a pretty bad bug .. although I couldn't re-produce it.

If you go to Webmin -> Webmin -> Webmin Actions Log and find the log entry for the record deletion, how many records does it say were deleted? I'd expect it to say something like "Deleted 1 DNS records in"

The strange thing is that in the Webmin Actions Log I do see an entry for:

Deleted 1 DNS records in

for a successfuly deleted entry in another domain just before that one that removed the whole content of the file

But there is no entry for the failed deletion. Looks like it failed/bugged without logging.

I have emailed you the content of the host file for that domain if you want to try again to reproduce the bug (i didn't try, as it's a live site).

That's odd - without the log entry, it's hard to say what went wrong here. On my test systems, deleting the MX works fine.

If you dare you could backup the zone file and try another single-record deletion.