Prevent automatic subdomain creation

Hi, when i add a new virtual server it adds additional subdomains to request SSL certificate however as the dns is not pointed for other it is getting failed and requires manual ssl request.

I am creating data.new.example.com

it also try to add and request ssl for

www.data.new.example.com
admin.data.example.com
webmail.data.example.com

I have already unchecked ftp. localhost. m. in Edit Server Template

www should be for root domain and not subdomain so it shouldn’t be added even i am adding a subdomain as top-level virtual server.

How to prevent this? I only want to use www for root domain and no extra alias for subdomains.

Hello,

Yes, it’s possible.

For Apache systems, you can edit the “Website for domain” template and remove the extra ServerAlias records. You can also disable Redirect admin.${DOM} and Redirect webmail.${DOM} options.

For Nginx, you can disable the redirects mentioned above, but www. and mail. records are still automatically added to the Nginx server config from hardcoded domain server names function, so they can’t be controlled directly for now.

@Jamie, we should improve this. Hardcoding these records isn’t ideal. Instead of adding mail. and www. to the Apache template by default, it should be an optional checkbox. The default Apache template should include only ServerName ${DOM}, with aliases added dynamically based on preferences—it would be simpler to implement and align the logic with Nginx for consistency.

1 Like

thanks, i am using nginx. strange creating new.example.com only create ssl for this but not when we add 3level domain name. one.two.example.com

I will leave it for Jamie to comment on.

  1. when i created domain1.com, it not creates www.
  2. When i created test.domain2.com it is good to go with no www.
  3. When i created files.test.domain3.com it adds additional alias.

=
WWW is checked so i only expect it to be added with root domain only.

should we need to make some change here?

It may be simpler to just have Virtualmin add the DNS records for these sub-domains, which can be done already via checkboxes on the “DNS for domain” section of the server template.

there is no dns server running. www, admin, webmail under the virtual server shouldn’t be added and request for SSL when it is a subdomain. currently subdomain subdomain.example.com request ssl for this specific name but not when i add sub.subdomain.example.com

ok i tried adding more domains and subdomains and it all adding www. admin. webmail. alias. i have added *.example.com pointed to ipv4 and ipv6.

strange it have seems to ipv6 and port when requesting ssl. both ipv4 and ipv6 is proxied on cloudflare. this prevents issuing let’s ssl certificate.

i manually need to request for the specific domain/subdomain.

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for site1.example.com and 3 more domains

Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
  Domain: admin.site1.example.com
  Type:   connection
  Detail: 2606:4700:3030::8815:7001: Fetching https://site1.example.com:10000/.well-known/acme-challenge/ID: Invalid port in redirect target. Only ports 80 and 443 are supported, not 10000

  Domain: webmail.site1.example.com
  Type:   connection
  Detail: 2606:4700:3030::8815:2001: Fetching https://site1.example.com:20000/.well-known/acme-challenge/ID: Invalid port in redirect target. Only ports 80 and 443 are supported, not 20000

Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.

Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

@Joe could you help?

Have you read the page you screenshotted here?

Do not request certs for domains that do not exist. It’s simple. You can choose which domains to request certs for, so do that. Select “Domain names listed here” and fill in the domains you do want to get certs for that have DNS records.

Also, if Virtualmin isn’t managing DNS, don’t lie to Virtualmin and let it think that it is. Disable the DNS feature.

DNS is disabled in Features and Plugins.

i have created site1.example.com and it is adding admin. and webmail alias. and try to request SSL certificates. the acme challenge id is trying to verify it over 10000 and 20000 port.

I’ll repeat myself:

Though I’m not sure about this:

I don’t know how that would happen, unless the redirects are broken. They should exclude anything with .well-known in the URL.

it verify the main domain but not over port because the dns is proxied by cloudflare. cloudflare not allow to access over 10000 and 20000 port.

i have made edits to prevent using alias for main and sub servers under Server Templates but it still creating them for some reason. i think it is a bug. could you check it once if i dm details?