You can make Adomain.com record A and all other CNAME domain names at www.domain.com. But this only "decides" that if the IP address of www.domain.com changes, you do not need to change another DNS channel, since they are aliases.
Thus, at the DNS level, there is no way to force redirects. And for a good reason, because DNS is used for more than just HTTP. For example, if the entire request for domain.com is redirected to www.domain.com, your email addresses will be changed to user@www.domain.com.
So, for HTTP redirection you will need to use an HTTP solution. It can be at the web server level (mod_rewrite, in code, javascript (ugh), etc.), but you can also have a proxy in front of your web server to handle this.
MichaΓ«l Hompus Mar 02 '13 at 8:28 2013-03-02 08:28
source share