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

I registered my domain foo.org and along with it they gave me foo.biz for free. I don't really like it, but as I said, they gave it to me for free... And I want to route absolutely every request involving foo.biz to foo.biz, including subdomains.

In the DNS configuration of foo.org, I set up @ and www, as well as the wildcard subdomain * as A records to my host's IP address,

For the DNS configuration of foo.biz, I was thinking of using 301 redirects but they don't play well with wildcard subdomains, or at least I have no idea how to achieve the automatic mapping I want, i.e., without having to do it manually for each subdomain and not use without the wildcard.

Since I really want to make foo.org. the canonical name and have foo.biz just as a cheap alias, it makes sense to resort to CNAME records, but how can I do that in order to achieve the mapping???

I'd appreciate your most educated advice!

Edit: I'm a DNS n00b... Also, it seems I can only edit my domain's DNS settngs on my registrar's website.

Edit: I'm using IIS.

share|improve this question
DNS is not capable of doing a "redirect". What you're asking for is not possible. The answer below is how to do a redirect, which is part of the HTTP protocol (again, not part of DNS). –  Chris S Sep 10 '13 at 19:59
Thanks for the advive. But so, does that mean that I am "doomed" to write a redirect rule or URL-rewrite rule on IIS to achieve what I want??? I have to say that I am somewhat incredulous about that fact... Would you recommend then simply going 1 by 1 on my sub-domains instead of using wildcards, and make each subdomain.foo.org the CNAME for each subdomain.foo.biz??? –  khovanskiiªn Sep 10 '13 at 20:43
Sorta yes. The easiest way to do what you want is to have one Rewrite rule in IIS, if the hostname doesn't match whatever you want the canonical name to be, then Redirect to the canonical name. Within each of the other domains, create a "default record" (usually a "@" A Record) which points to the web server. This way a user can type anything.foo.org and the server will get the request, see the wrong name, and redirect to www.foo.biz. –  Chris S Sep 10 '13 at 22:10

1 Answer 1

Add following in front of your foo.org virtual host:

<VirtualHost *:80>
    ServerName foo.biz
    ServerAlias *.foo.biz
    RedirectPermanent / http://www.foo.org/
share|improve this answer
I forgot to mention: I'm a DNS n00b... Also, it seems I can only edit my domain's DNS settngs on my registrar's website. –  khovanskiiªn Sep 10 '13 at 18:00
His answer is for inside Apache, not in DNS. –  TheFiddlerWins Sep 10 '13 at 18:02
Oh, OK, thanks for the clarification. But in that case, since I am using IIS are you saying that I should do this via some Redirect/URL-Rewriting??? Isn't there a DNS solution to this? –  khovanskiiªn Sep 10 '13 at 18:04
You have to do this via redirect, if you want the foo.org as result. If foo.biz can stand in the browser, simply let IIS react on both domains and the DNS settings on both domains can be simply the same. –  Pazi ツ Sep 10 '13 at 18:05

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.