Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I plan to setup a site domain1.com but want all the traffic coming to it redirected to domain2.com.

If I do that, will there be any issue in creating subdomain1.domain1.com and subdomain2.domain1.com ?

Thanks !

share|improve this question

closed as off-topic by Ƭᴇcʜιᴇ007, Indrek, and31415, harrymc, Kevin Panko May 26 at 20:30

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question is not about computer hardware or software, within the scope defined in the help center." – Ƭᴇcʜιᴇ007, Indrek, and31415, Kevin Panko
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Please explain what you mean by "all traffic" (SMTP? SNMP? HTTP? RPC?). What kind of redirect? DNS-level, HTTP-level, network-level? –  milli Mar 26 at 17:09
    
I meant HTTP traffic. Sorry I should have been more specific. –  vibez_well Mar 28 at 14:21

2 Answers 2

up vote 0 down vote accepted

Domains don't deal with "traffic", they're just pointing out the IP address to contact a server. You can obviously set a different IP adress for topdomain.tld and subdomain.topdomain.com. In your case you even want to alias domain1.com to domain2.com, with a CNAME for exemple. You can then add a DNS A/AAAA record for subdomain1.domain1.com and subdomain2.domain1.com. DNS zone will look like something like this:

domain1.com. CNAME domain2.com.
subdomain1.domain1.com. A 255.255.255.255
subdomain2.domain1.com. A 255.255.255.255
share|improve this answer

The short answer, for HTTP, is No. domain1.com and domain2.com can have either the same A record or different A records in DNS. The web server you land on by using http://domain1.com has to have rules that rewrite the URI to be http://domain2.com and send a 301 Moved Permanently redirect response. This will cause the name to change in the browser and reload the new site.

This has no effect on domain names like subdomain1.domain1.com which can be added with their own A records or even a CNAME.

Note: For real domain names called domain1.com and domain2.com, those are second-level registrations thus you cannot use a CNAME for those as they are by definition zone apex domains which have SOA and NS records attached. CNAMEs are illegal with any other record types.

share|improve this answer

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