Aliases for Virtual Servers

I manage a non-profit community network with approximately 100 clients. In the past, I've created aliases for clients without any problem. Recently, 2 different aliases failed because the zone file was blank (Webmin -> Servers -> Bind DNS Server, zone file was blank). Once my tech support consultant discovered the problem we were able to copy and paste, then modify the files from the original virtual domain. Has a recent update changed how aliases should be created? Why weren't the files created automatically when the alias was created?

Status: 
Closed (fixed)

Comments

Jamie, I've seen this recently too, and just wrote it off as a fluke. I wasn't able to reproduce it.

But in at least one case, creating an alias in Virtualmin 3.81 didn't generate a BIND .hosts file. It did create the zone entry, but the corresponding hosts file wasn't there. My issue wasn't on CentOS like spool here who reported this bug, I was using Ubuntu 8.04 when I saw the issue.

In the 3.81 release, the way records for alias domains are created changed a bit - they are now copied from the records for the target domain.

In cases where you have seen this, did the target domain have a zone file? If so, is it visible in Virtualmin at Services -> DNS Domain.

The target domains had zone files. That's what we copied, pasted, & revised to make the aliases work. I can't confirm that they were visible in Virtualmin at Services> DNS Domain because we found them via Webmin -> Servers -> Bind DNS Server.

Is this problem repeatable? You could test by creating another alias of the same domain you had a problem aliasing originally, and seeing it gets a zone file or not ..

Hi All, Yes Jamie, this problem is repeatable and I have the same issue with the same version as below: Operating system CentOS Linux 5.5 Webmin version 1.520
Virtualmin version 3.81.gpl GPL

Whenever I create a new alias to any domain, the zone is added in the named.conf file (as a master zone) but the *.hosts file is not generated as it was before... the DNS service will not start if I try to restart or reboot the server I get these types of messages when DNS service starts:

* zone alias1.domain1.com/IN: loading master file /var/named/alias1.domain1.com.hosts: file not found
* _default/alias1.domain1.com/IN: file not found
* zone alias1.domain2.com/IN: loading master file /var/named/alias1.domain2.com.hosts: file not found
* _default/alias1.domain2.com/IN: file not found 

I hope there's a quick remedy to this as it's starting to be a manual work editing and copy and pasting everywhere ;) THX for any helpful informations to fix this issue.

EDIT: IMPORTANT! I found out that this error apply when you add an alias with a different domain name than the parent domain name, then the *.hosts file is not created, however if the domain name of the alias is the same as its parent the *.hosts file is not created but there's a dns record added on the parent domain zone.

I hope the above EDIT is useful for Jamie to trace the problem.

So in the case where this fails, is the alias domain a sub-domain of the orignal?

For example, is the target example.com and the alias foo.example.com ?

In our case, the alias is not a sub-domain. All our clients begin as username.avenue.org. When clients choose to register their own domain names, I create an alias of the original account for whatever that domain name happens to be. To use your example, the target is example.avenue.org and the alias would be example.org. As I said in my original post, I've done it several times in the past and only recently had problems.

I agree with nousa, I hope this gets fixed because manually editing the files is more prone to error and tedious.

I have been unable to trigger this problem during testing.

If you can repeat this consistently for a specific target domain, I could perhaps login to your system and see what is going wrong?

Jamie, here is my situation:

1) it works fine if I choose to add an alias to a top level domain with the same domain name suffix (it add the appropriate records in the top level dns zone) as per example below, and that's working perfectly for me:

top level domain = support.example.com

alias to the top level domain = somealias.support.example.com

2) it does not create the *.hosts file if I add an alias with a different domain suffix name than the top level domain, as per example below:

top level domain = support.example.com

alias to the top level domain = support.anotherdomain.com

bear in mind that in option (2) I have already a top level domain called anotherdomain.com on the same virtualmin server but due to some policy I have to have support.anotherdomain.com as an alias to support.example.com website.

in option (2) like I wrote before, it create the alias in the virtualmin webgui console, but in "virtualmin --> aliased domain --> servcies --> DNS domain" there are no (empty) DNS records, when I try to restart the DNS service, the DNS service fail to start with the error I pasted above (post #5) so I have have to create manually the file through ssh console to get the DNS service to start in my virtualmin server.

Does this make it more clear Jamie? If you have any question, I'll be glad to try answer it ASAP. Regards, Anis

nousa - in case 2, are support.example.com , support.anotherdomain.com and anotherdomain.com all owned by the same Virtualmin user?

While looking into this, I found a bug that could trigger if the alias is a sub-domain of another existing domain with the same owner. If you like, I can send you a fixed version of Virtualmin to test with. Just let me know which Linux distribution you are running on, and if you have the GPL or pro version.

Jamie, no, beceause support.anotherdomain.com is an alias domain of support.example.com so these two domains are owned by the user "support" (reading it from the files and folder owners through ssh)

anotherdomain.com is owned by "anotherdomain" user (and a group called "anotherdomain" as well)

the infrastructure is live production, so if the fix will not get me into a trouble then I'll be happy to test (you will have to let me know as well what are the steps to follow in a clear manner :) )

I'm using CentOS Linux 5.5 , Webmin version 1.520 and Virtualmin version 3.81.gpl GPL

Regards, Anis

I've sent you an updated RPM - let me know how it goes.

Thanks Jamie,
I applied the rpm file you sent me, it creates the *.hosts file but this file is empty and it include only the line below:

$ttl 38400

so it's missing all the required minimal records (SOA, TTL's, NS and the A record for that Alias), when restarting the named service on the ssh console I get the error below:

zone support.anotherdomain.com/IN: has no NS records
_default/support.anotherdomain.com/IN: bad zone
[FAILED]

I believe this is a small tweak that can be easily fixed ;)
Regards,
Anis

Thanks, Anis for picking up on my original posting. I'm in over my head and anything I would try to test would be a disaster. I'm looking forward to a solution that we can all install with the next upgrade.

Stella

Thanks, that is useful information. Anis - I have sent you a new update that should fix the problem this time.

Jamie,
This is it, I've tested it on my live environment with few different aliases for few top level domains (all possibilities that failed before) as well as checked the logs after restarting the DNS services and it work perfectly now, all is clean after this last update you sent me.
IMHO we can close this ticket and tag it as resolved so you can push this updated package in the next update release.
Thank you very much for your quick reaction and keep up the good work! bravo!

Regards,
Anis

Cool .. we plan to release Virtualmin 3.82 this week, which will include the fix.

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