"Add sub-domain DNS records to parent domain?" doesn't work for aliases

Operating system:Ubuntu
OS version:18.04.5
Latest Webmin / Virtualmin
All packages are up-to-date

I’m in the middle of building my web hosting environment with webmin and virtualmin, but I have been halted by something.

I use a third party service provider as secondary DNS, where payment is due based on the number of DNS zones, thus I don’t want to create too many zones in my system unless it’s indeed justified, so I was really happy to see that it is possible to set in the BIND DNS domain settings among the server templates that whenever a subdomain is created, the system adds the appropriate records in the parent’s domain zone without creating an own DNS zone.

This setting works properly whenever a sub-server is established, but as for aliases whatever the setting is in the above mentioned template settings, there is always a new, separate DNS zone created. As I use quite a number of aliases, which are also subdomains (example.com -> alias.example.com), for me this solution would be rather expensive at my secondary DNS service provider. To tell the truth I don’t really understand anyway why would that be a better solution to copy the DNS zone of the parent and supplement it with the new records. This, on the one hand, seems to be unnecessary redundant, and, on the other, should there be too many subdomains, it is quite chaotic to handle that many DNS zones. And why this type of operation is more justified for a sub-server than an alias, as the alias is even closer to the parent. Not to mention that default aliases (www, mail, admin, etc.) are solved by also virtualmin by means of additional records in the parent zone. Why is it impossible to solve all the rest like this?

First I was of the opinion that this should be a bug, but having looked at the source code, it seems that the case of creating an alias was intentionally left out of this feature (see line 56 in feature-dns.pl).

Of course this limitation could be bypassed in many ways, for example the code could be patched (but I wouldn’t opt for this solution, as then it would be difficult to manage the updates), or whenever an alias is created, DNS management could be turned off, and the necessary records could be created either manually or by using an automatically running script (in my opinion the necessary records are the three A type ones: alias, www.alias, mail.alias), but here it would be important to delete the records whenever the alias is terminated. It would be much more convenient if the same could be applied here as with the sub-server, where everything is automatically created, deleted, etc… And of course, it wouldn’t be obligatory to turn on this featue in the templates, if this solution is not suitable for a user.

Is there anyone who could explaine me why the creation of aliases is intentionally excluded from this feature? Are there any serious disadvantages of adding DNS records into the parent zone, which justifies even the option of selecting the other type of operation to be excluded?

And what would you suggest? Which path shall I take if I insisted on applying the solution I described for creating alias subdomains?

I use Ubuntu 18.04.5 with the latest webmin/virtualmin, all packages are up-to-date.

Thank you very much for your reply!

Creating an alias which can be treated by the Virtualmin ecosystem as a seperate entity gives the person using the Virtualmin GUI many more options and therefore flexibility in how the alias can be configured and used. That would be my guess.

You will have to wait for the admins to provide you with the canonical answer.

Addendum: AWS charges by zone, Rackspace charges a flat fee of USD 5 for unlimited zones and records on their very powerful DNS system and you get 50 GB of object storage included for free, along with other goodies like 50,000 email via MailGun, server monitoring (with their client installed or even without) with global sms and email notification and a few more things which I don’t use. Good value for USD 5, I think.

I’m not sure why it would be this way. I would have assumed that aliases that are subdomains of the parent it would make sense to use the existing zone…seems lighter and aliases seem like they should be light.

By enabling the “Add sub-domain DNS records to parent domain” setting regarding the creation of aliases, a separate entity is created, which can completely be managed via the Virtualmin GUI. The single difference is that there is no separate zone file created, but on the settings side of the alias server one can easily edit the alias related DNS records in the parent zone.

My knowledge above is based on tests, after having modified the source code of virtualmin (altogether a single line needs to be modified for this, eliminating the condition excluding alias creation from this feature). Everything can be easily solved and edited via GUI. E.g. I changed the name of the domain, and as a result, the DNS records in the parent zone have also automatically been modified.

It also doesn’t make sense, because even if the condition excluding the creation of aliases is deleted from the code, the option is still given to create aliases with separate zone files, and even more, by creating various templates, it is also possible to create certain aliases with zone files, and others with records added only to the parent. However, this is currently forbidden at code level.

Of course, in my case everything works properly, but wouldn’t it be possible to include it into the code, so that no patch would be necessary from the next release on for all those, who need this feature? What is the process of that? Is it enough to indicate this demand here, or shall I post a ticket in the Issue queue?

It’s Open Source, make a PR! Or post a patch on an issue in github. Reference this thread, if you do, and link to the issue or PR here, so it’s all documented for future spelunkers.

OK, I created a pull request here: Fixing the "Add sub-domain DNS records to parent domain?” doesn’t work for aliases issue by searosin · Pull Request #248 · virtualmin/virtualmin-gpl · GitHub


This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.