5

I'd like to setup a catch-all for my subdomains:

*.domain.com.    CNAME    domain.com

But, a few specific subdomains should have their own entry:

mail.domain.com.    A        X.X.X.X
*.domain.com.       CNAME    domain.com

The problem is, how can I specify that I want the first rule to be processed before the catch-all?

As far as I can see, there is no way to reorder the rules. So, if I create a rule after the catch-all, the catch-all might be processed before the specific rule.

There's a weight parameter, but it doesn't look like it's designed for this purpose, but for load balancing.

BenMorel
  • 4,507
  • 10
  • 57
  • 85

1 Answers1

5

Reply from the AWS support (emphasize mine):

If you setup a wildcard DNS entry for your Domain this will catch all queries where you haven`t specified a record.

As example:

localhost.domain.com. A 127.0.0.1
*.domain.com.         A 127.0.0.2
www.test.domain.com.  A 127.0.0.3

A query for localhost.domain.com. will return the specified A Record 127.0.0.1
A query for test.domain.com. will return the wildcard record 127.0.0.2
A query for www.test.domain.com. will return the specified record 127.0.0.3

This means a specified Record within your hosted Zone will always have a higher priority as a wildcard record.

BenMorel
  • 4,507
  • 10
  • 57
  • 85