1

I initially added a wildcard subdomain as below on my cpanel account and it works fine (all level of subdomain works):

  1. *.example.com

but when I add following second wildcard subdomain to explicitly install ssl for that:

  1. *.co.uk.example.com

any domain ending with .uk.example.com no longer work (e.g. uk.example.com or test.net.uk.example.com ... etc)

is there anything wrong with dns server bind or is this by design?

5
  • you need to a wildcard for every subdomain, a wildcard like this *.co.uk.example.com cannot match test.net.uk.example.com, because you need *.net.uk.example.com
    – c4f4t0r
    Jun 1, 2019 at 19:49
  • isn't *.example.com wildcard supposed to match uk.example.com or test.net.uk.example.com host
    – Deepika
    Jun 1, 2019 at 19:52
  • you need a wildcard for every domain level, *.example.com match uk.example.com but not test.net.uk.example.com
    – c4f4t0r
    Jun 1, 2019 at 19:56
  • *.example.com matches every level. when I remove second wildcard *.co.uk.example.com, it works with all level of subdomain (e.g. uk.example.com or test.net.uk.example.com). But having second wildcard dns, it no longer work.
    – Deepika
    Jun 1, 2019 at 20:00
  • (This question is not a duplicate. It shouldn't have been closed.)
    – KajMagnus
    Jun 5, 2022 at 6:22

1 Answer 1

5

It sounds like everything is working as intended and that the confusion here stems from not knowing how DNS wildcards are supposed to work.

The wildcard matches any names below the point of wildcard record which are in branches that do not exist (keep in mind, DNS is a tree).

When you added the new *.co.uk.example.com record (doesn't particularly matter that this new record was a wildcard too, any record would have caused the same kind of effect, eg if you had added foo.co.uk.example.com) this means that uk.example.com now is part of an existing branch and now your old *.example.com record no longer applies to anything that ends in uk.example.com.

If you really want to use wildcards (usually better to avoid this, but you don't explain your use case), you will likely want to add specific records for all of uk.example.com, *.uk.example.com, co.uk.example.com to restore some kind of similar functionality as you had before.

Not the answer you're looking for? Browse other questions tagged .