1

Newbie webmaster here: I have 2 domains mydomain.com and mydomain.net. I want a permanent redirect so that if anyone browses to mydomain.net they navigate to mydomain.com. Is there a way to do this using DNS records?

1

You could create a CNAME record for your .net domain, this way your DNS will translate mydomain.net to mydomain.com.

  • Thanks - so to clarify, I should create a CNAME for "*" that points at "mydomain.com"? Will that mean that the url will automatically change to mydomain.com? That's important, because the web server will dish up content according to what URL is requested. – Shaul says I Support Monica Oct 28 '13 at 9:34
  • 1
    Unfortunately, users see whatever they typed. The DNS only tells the user where the website is hosted. Since you want a HTTP redirect (like HTTP 301), you should configure that in a virtualhost of some kind – Ronald Swets Oct 28 '13 at 10:45
  • So DNS can't do an automatic URL rewrite? – Shaul says I Support Monica Oct 28 '13 at 11:13
  • 1
    Correct, DNS has nothing to do with HTTP, basicly it only translates between names and IP addresses – Ronald Swets Oct 28 '13 at 11:17
1

You can try http://redirect.center.

In your case, configure your DNS like this:

mydomain.net A 54.84.55.102
redirect.mydomain.net CNAME www.mydomain.com.redirect.center
www.mydomain.net CNAME www.mydomain.redirect.center
1

You won't be able to "redirect" using DNS records.

As mentioned:

You could create a CNAME record for your .net domain, this way your DNS will translate mydomain.net to mydomain.com.

This is a good first step, but this only sets the domain to point to the same IP, it doesn't actually perform any redirecting. Once the domain is pointing to the same place you can then set your webserver (Apache/NGINX/IIS/&c) to HTTP redirect traffic from one domain to the other.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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