Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.