Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I have a wildcard domain, is it possible to list specific subdomains that override the wildcard one?

For example:

* 3600 IN A 3600 IN A
share|improve this question
up vote 9 down vote accepted

Yes, this works.

share|improve this answer
Absolutely. The * record is only consulted if there are no more specific records that match the query. – David Mackintosh Jun 2 '09 at 19:27

Yes, like Zoredache says, "this works".

There are some caveats though with wildcards that it's worth knowing:

  1. The wildcard matches one or more labels, so in your case will be matched by the wildcard, but will return NXDOMAIN because the presence of foo prevents any sub-domains of foo from matching

  2. The wildcard match is RRtype specific. However If the wildcard and override records don't have the same RRtype then the over-riding records will still "hide" the wildcard, but you get NODATA (i.e. no answer, rcode == NOERROR).


*     IN A
foo   IN TXT "foo"

% dig @localhost A
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36960
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
share|improve this answer
Sorry but this is a bit cryptic for me to understand. – Unknown Jun 3 '09 at 8:02
Does a definition of * work to avoid NXDOMAIN for ? – Steve Schnepp Jun 3 '09 at 9:25
@Steve - I believe so, yes. (I haven't tested it though) – Alnitak Jun 3 '09 at 15:06

Your Answer


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.