1

I want to setup dns to allow wildcards

eg. xxx.mycompany.com

So I have setup the following dns entry *.mycompany.com 111.111.111.111

However just visiting mycompany.com does not resolve.

For now I've added an extra entry in for mycompany.com 111.111.111.111

Is there a better way to do this?

2 Answers 2

4

Wildcard will always only match the subdomains you defined, so in your case if you want to resolve the domain by itself you have to add an extra @ record.

1

To add to what golja says:

The root level domain is never handled by a subdomain or subdomain wildcard. Essentially anything that appears before the period of the root domain indicates a subdomain from the root, it does not modify the root.

So, regardless of any subdomain wildcards or even subdomain records you create, the root domain will always have to have an A record or CNAME (although not highly recommended).

Your DNS config should look something like this:

A | mycompany.com   -> 123.123.123.123
A | *.mycompany.com -> 123.123.123.123

This should give you the following usable DNS records:

  1. mycompany.com
  2. www.mycompany.com
  3. finance.mycompany.com
  4. etc. etc.

You must log in to answer this question.

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