Virtualmin clears DNS zone on virtual servers with aliases. This happens only when aliases are subdomains of main server and their DNS records are in one DNS zone file.
For example, we have virtual server "test.com" and alias "alias1.test.com". We put DNS records in one DNS zone file:
test.com. IN A 1.2.3.4
alias1.test.com. IN A 1.2.3.4
Now if we add any record into domain zone "test.com" from virtualmin panel ("Edit Virtual Server" -> "DNS Records" -> "Create record of type..."), DNS zone file '/etc/namedb/master/test.com' will be cleared and error message "No records for alias target test.com found" will be produced.
I've already found why it happens. It is in subroutine "post_records_change" from module 'feauture-dns.pl', line 2799 (as of Virtualmin 4.02.gpl GPL). There is a code that clears the file:
&open_tempfile(EMPTY, ">$file", 0, 1);
&close_tempfile(EMPTY);
I don't understand what's purpose of that and there are no comments. This code might work for cases when aliases are in different DNS zones, but it causes data loss for situations like described.
Comments
Submitted by JamieCameron on Tue, 08/19/2014 - 17:59 Comment #1
Thanks for pointing this out - I never considered the case where an alias domain was also a sub-domain :-(
This will be fixed in the next release though.
Submitted by Issues on Tue, 09/02/2014 - 18:01 Comment #2
Automatically closed -- issue fixed for 2 weeks with no activity.