Wildcard dns bug

I've enabled wildcard dns :

Service configuration -> Website options -> Website matches all sub-domains -> Yes

Sot the feature gotenabled correctly.But when I run :

virtualmin disable-feature --dns --web --all-domains

and then run :

virtualmin enable-feature --dns --web --all-domains

I can see wildcard dns and virtualhost records are not set at all, also the 'Website matches all sub-domains' option has changed to no !

Status: 
Active

Comments

That is expected .. when you disable the website and DNS zone for a domain, all records and the apache config are lost. This also applies to any other web-related settings, such as a the PHP execution mode, per-directory PHP versions, redirects and proxies.

Mostafa's picture
Submitted by Mostafa on Mon, 09/12/2011 - 23:45

They can be stored in /etc/webmin/virtual-server/domains/ for future use.

Yes .. but this goes against the general design of Virtualmin, which is to store all settings in the underlying configuration files where possible.

Out of interest, why are you trying to delete and then re-create the websites for all your domains?

Mostafa's picture
Submitted by Mostafa on Tue, 09/13/2011 - 04:05

hm, I myself use it because of making group changes to /etc/webmin/virtual-server/domains/ files, for instance I've migrated a cpanel file, the dns_ip was not set and so the records was pointing to 127.0.0.1, or running a reverse proxy,...

I think maybe suspending a virtual-server and unsuspending it also affected by this issue (?).

Suspending and un-suspending won't cause this issue, as they keep the current config.

If you want to force re-setup of DNS records, just disabling and re-enabling the dns feature should be enough.

Mostafa's picture
Submitted by Mostafa on Tue, 09/13/2011 - 14:20

A wildcard dns uses both DNS records (*.domain.com in A ... ) and virtualhost (Server alias *.domain.com)/

Mostafa's picture
Submitted by Mostafa on Tue, 09/13/2011 - 14:22

A wildcard dns uses both DNS records (*.domain.com in A ... ) and virtualhost (Server alias *.domain.com)/

Ok, that's a bug .. if you disable and then re-enable DNS, the * record should be put back. I will fix that in the 3.89 Virtualmin release.

Mostafa's picture
Submitted by Mostafa on Wed, 09/14/2011 - 02:01

No , It's not a bug.I've checked /etc/webmin/virtual-server/domains/ file of related virtual-server.As the wildcard record is not stored there, so disabling and enabling it should not add any DNS or vhost record.

Please either add both dns (*.mydomain.com. IN A ...) and vhost (ServerAlias *.mydomain.com) records or not touch current config.

:D

What I meant was, if a domain has a wildcard DNS record and a *.domain.com ServerAlias in the apache config, disabling and then re-enabling DNS should put back the wildcard DNS record.