1

I have a page at domain1.com/page/ which I'd like people to also access from domain2.com domain3.com

Or ideally on domain2.com/page/ domain2.com/whatever/

I'm not looking for a redirect, I want the visitors to remain on whatever domain they typed.

I'm not looking to mirror a whole site or every page on my domain. Just to allow other people who own domains to "host" my page on their domain, subdomain or a certain URL on their domain.

Is the correct way to achieve this is a CNAME record? And if so what would be the correct way to set it up?

1 Answer 1

3

There is a LOT more to this then using a CNAME record. A CNAME record will only indirectly convert a subdomain to an IP address.

In addition to setting up a CNAME record you will need to modify the server to serve up the page. There are a couple of things to consider here -

  1. In your web server - you will need a special configuration that either lists all the domains that redirect here (as ServerAliases in Apache if thats what you are using) or create it as a catch-all

  2. The harder part would be handling SSL. If you are using HTTPS you will need to update your certificate to include all the subdomains you wish to answer for (ie Subject Alt Name lines). There is no practical catch-all solution here unless you can use the form domainXX.mysubdomain.com where domainXX can be anything, but you own mysubdomain.com and use a wildcard certificate to cover (anything).mysubdomain.com

An alternative solution/partial solution would be to use / set up some kind of reverse proxy. This is not something trivial for your clients (ie the ones with subdomains) to set up, although it may be possible that Cloudflare or similar can help here in which case they may be able to do it with DNS - I've not used their services much.

Large providers use a combination of 1 and 2 above, with automated/semi-automated processes to help them.

1
  • Thanks thats very helpful and makes sense.
    – Adam Tal
    Jan 17 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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