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 might be over complicating this but...I am hosting several websites and dns for the domains on a single server:

  • domain1.net
  • domain1.com
  • domain2.net

I have three items which I'm trying to work out whether to achieve by DNS, by IIS hostnames(bindings), or by IIS redirect.

1. Where I have domain1.net and domain1.com, I want everything from both (all emails and web requests) to just point to the domain1.net. Can I do this at the DNS level, or do I have to set up the email as forwarders on the email server and the domain as a hostname in IIS? For example:

  • richard@domain1.com > richard@domain1.net
  • www.domain1.com > www.domain1.net

2. I want to make sure that requests for domain1.net and www.domain1.net both resolve to the same place. Should this be done with DNS or with multiple hostnames, or with IIS redirects?

3. If I then want to have one webmail site serving all of domains (webmail.domain1.net, webmail.domain2.net), is it best to this with a cname in DNS or with host headers in IIS?

share|improve this question
add comment

1 Answer 1

  1. For email, I don't think you can do this with DNS. The only time DNS is involved with mail is for determining which server to send mail to for the requested domain. So whilst you can have the MX records for both domain1.com and domain1.net pointing to mail.domain1.com, say, you will need to configure that server to accept mail for both domains, and route it to the correct mailbox as appropriate. Exchange will do all of the above out of the box.

For web requests, (and this answers #3 too), it depends on whether you care about the host name that ends up in the address bar of the browser. If you don't then you could just CNAME www.domain1.com to www.domain1.net, and as long as you have both hostnames as vaild host headers for the site in IIS/Apache, the page will load and all will work. I wouldn't recommend this however as all it takes is one absolute href and the user is bounced to the other domain, not to mention issues with SSL and wider business branding problems, SEO, the list goes on.

To do that properly, use a redirect rule and bounce all traffic to one domain.

  1. IIS redirect is the neatest way, keeps everything consistent. You could just add A records for both in DNS and add both as accepted host headers for the site in IIS though. Up to you.

  2. As 1. but bear in mind that if you want to use SSL you will need a dedicated server IP for each site, so it might be simpler to redirect everything to one place and then secure that.

HTH

share|improve this answer
add comment

Your Answer

 
discard

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