0

I'm using GCE to set-up Virtualmin. Everything works just fine, but, here's the catch.

In the GCE DNS Zone I've pointed my domains this way:

example.com  A  35.234.122.118
www.example.com  A  35.234.122.118
*.example.com CNAME example.com.

The issue is that when I'm opening existing subdomains, everything works fine. But the problem is that I can access the root subdomain of example.com just by typing anything I want, for example blabla.example.com/panel acts like example.com/panel.

I'm not into DNS so much, so I'm sure there's someone out there to help me out with that.

Patrick Mevzek
  • 9,921
  • 7
  • 32
  • 43

1 Answers1

0

That wildcard alias is acting as a catch-all for your domain.

Change the wildcard CNAME entry to just www.example.com CNAME example.com. Then, add an individual CNAME (alias) for any other subdomain that you want to redirect to the root domain.

Patrick Mevzek
  • 9,921
  • 7
  • 32
  • 43
SamErde
  • 3,409
  • 3
  • 24
  • 44
  • The problem is that my Virtualmin instance is for a freelance hosting with WHMCS, so all that stuff has to be automatic and there's no place for registering every alias manually. – Krzysztof Krysztofiak Jun 01 '18 at 18:41
  • 1
    @KrzysztofKrysztofiak SturdyErde is right, you either use a catchall which, as it name implies will catch any name, or you need to list the names one by one. However you probably have a catchall website in your HTTP server and you should instead generate a standard error, if each true website is defined separately in your webserver. – Patrick Mevzek Jun 03 '18 at 22:57