4

My main domain is example.com, but also bought example.org and example.net. I've configured my webservers at *.example.com to handle requests from the other domains and redirect them correctly to example.com, but I'd rather not re-configure all my DNS records at example.org and example.net to be the same as example.com.

Other than writing some ugly synchronization script, what should I do to have route53 answer queries against my "other" domains with the same data from the "main" domain?

dunxd
  • 9,632
  • 22
  • 81
  • 118
Yaniv Aknin
  • 137
  • 5
  • I do not know if this is the only answer, but I simply ended up coping over everything... Ugly and tiresome solution. Would be nice to see better solutions. – Grumpy Dec 11 '12 at 12:40
  • I know it's pedantic, but example.com and example.net are not identical domains. The suffix implies no relevance to any other domain. A trait spammers and cyber-squatters just *love*. – Sirex Dec 13 '12 at 19:36
  • @Sirex yep, that's why we're buying our brand's 'name' for other TLDs. You and I may know that example.com and example.org aren't the same, but maybe my users don't know that... – Yaniv Aknin Dec 13 '12 at 20:35

2 Answers2

1

I'm going through the same. Have you considered a simple URL redirection service? Do you want *.org and *.net to be rewritten to the *.com address?

If so, it seems like a redirect at the registrar level may be the cleanest solution.

Also see:
Redirect all traffic from http://example.com to http://www.example.com at the DNS level
and
How do setup DNS based URL forwarding in Amazon Route53?

ewwhite
  • 197,159
  • 92
  • 443
  • 809
  • I've considered a registrar's redirection service, but since I may have many (say, 15) alias domains from more than one registrar, I was hoping for something more robust... Lets wait a bit to see if someone comes up with a better solution, though I'm having doubts by now. – Yaniv Aknin Dec 12 '12 at 06:05
1

This is a common requirement for one of our clients. They will often buy 10-15 domains related to a campaign, one of which will be the "root" domain to which all others point. @ewwhite is correct that the cleanest solution is setting up DNS for only the root domain and just using forwarding at the registrar level for all the rest.

But to be clear: there's no way to do redirection like this using Route53, or to use wildcards with domain names themselves.

If you something that you control on your end of things, I would suggest pointing all the "extra" domains to the IP of a server that you can run Apache or NGINX on, and then create a site with a simple config (it doesn't need a webroot at all) that listens for all of those names and redirects automatically.

In Apache, within your <VirtualHost *:80> section for this site, you need only three lines:

ServerName mydomain.com
ServerAlias *.mydomain.* myotherdomain.* *.myotherdomain.* yetanotherdomain.*
Redirect 301 / http://mymaindomain.com/

In NGINX you can do this even more easily, within a server declaration:

server {
    server_name mydomain.com ~^(www\.)?(mydomain.+)$;
    rewrite ^ http://mymaindomain.com/;
}

I should also note that one cool advantage of running your own redirects like this is that you can parse the log and get decent analytics on how many people hit your site via those different paths. I've even known of companies seeding different audiences (or marketing channels) with different domain names, so that they know who would be coming in under each name. In that case you would probably want to make that a 303 redirect in the Apache config above.

Neal Magee
  • 329
  • 1
  • 7
  • Thanks, but I think the question already says "I've configured my webservers at *.example.com to handle requests from the other domains and redirect them correctly to example.com"; that's not the issue at hand. As for registrar forwarding, see my comment to @ewwhite's answer. – Yaniv Aknin Dec 13 '12 at 20:33