Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

This question already has an answer here:

Is there a way to redirect an entire domain to another domain through one CNAME record?

For example [anyhost] pointing to [anyhost] where no matter what host name I enter in it will point to the actual ip address of the SAME host name in If I ping it will resolve to's ip address. Or if I ping it will resolve to's ip address, and so on. I know I can enter a CNAME record for each host in but that is tedious. Some of the other questions asked in this area shows answers where a specific ip address is used for a default for the domain and that is not what I am looking for as an answer.

Incidentally, I tried using CNAME * * and it didn't work.

share|improve this question

marked as duplicate by Andrew B, longneck, mdpc, MadHatter, Ward Aug 6 '14 at 20:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Even if wildcard DNS worked this way (it does not expand past a label, i.e. is not matched by *, you'd still run up against the inability to CNAME the apex record. – Andrew B Aug 5 '14 at 18:37
@AndrewB It actually does expand like that (* will match provided that neither nor exist) – Håkan Lindqvist Aug 5 '14 at 18:39
@Håkan Point taken, I stand corrected. – Andrew B Aug 5 '14 at 18:47
If you control both zones, just use the same zonefile for both on the master. – MadHatter Aug 6 '14 at 16:49

I'd be copying one of the forward zone records to the other zone, making some type of global edit, and then using both.

I can see that you could do this with include files to maximize the amount of sharing while minimizing problems.

share|improve this answer

The problem with your attempted * CNAME * is the value (the canonical name). A CNAME record specifies exactly one name as the canonical name and putting a wildcard there doesn't really mean anything.

There is a somewhat obscure record type that does match the kind of behavior that you describe: the DNAME record type.

If you have a record DNAME that means that the authoritative server will, as part of its record lookup process, synthesize CNAME records as necessary to map names under to the corresponding name under (eg CNAME

And as the actual DNAME record isn't presented to the client (unless the query is specifically for the DNAME record type), the relative obscurity of the record type should only be a factor in that your authoritative nameservers must support it.

The question does not mention dealing with the zone apex, but if that is your goal then this solution will not handle that. (CNAME cannot exist at the zone apex.)

share|improve this answer
I took "entire domain" in the summary to include the apex as it was not worded as "all subdomains". Kudos for being aware of DNAME all the same. – Andrew B Aug 5 '14 at 19:12
@AndrewB Yeah, you may be right. The rest of the question seems to focus on *, though. Either way, I hope it may be useful because I believe this is as close as it will get to what the question seeks. – Håkan Lindqvist Aug 5 '14 at 19:28
I don't think Windows Server 2012 DNS supports DNAME records and CNAME records are host related, not domain related. Looks like I'm stuck with created records for each host. – Corey Aug 6 '14 at 15:38
@Corey I don't have msdns readily available to look at but DNAME is listed here – Håkan Lindqvist Aug 6 '14 at 16:28
I looked down deeper into the DNS interface and DNAME records are supported. They are classified as "Other" records. I'll look into using them a little later. I may be on to something. – Corey Aug 6 '14 at 16:50

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