How to point a root domain or IP to another domains subdomain?

Viewed 338

We are enabling our clients to route their subdomains, like sub.client1.com and sub.client2.com, to our servers where the clients websites are hosted.

We ask our clients to create CNAME records that points to our-sub.domain.com, e.g.:

CNAME sub.clientx.com -> our-sub.domain.com

We then have an A record that points our-sub.domain.com to our web servers IP addresses, like 1.11.111.11 and 2.22.222.22:

A our-sub.domain.com -> [1.11.111.11, 2.22.222.22]

Our internal setup can then switch these underlying IP addresses without any changes required in the clients DNS:

A our-sub.domain.com -> [3.33.333.33, 4.44.444.44]

But what if the clients want to route their root domains to us, like client1.com and client2.com?

  • They can't create a CNAME record for a root domain
  • They can't point an A record to our subdomain, because only IP addresses are allowed

Maybe we can solve it by creating a static IP like 0.00.000.00 that clients can route to with a simple A record:

A clientx.com -> 0.00.000.00

We could then do one of the following:

1:

Re-route to all of our web server IP's with an internally managed A record from 0.00.000.00, e.g:

A 0.00.000.00 -> [1.11.111.11, 2.22.222.22]

2:

Re-route 0.00.000.00 to our-sub.domain.com, because it is already routing to our web server IP's. I have noticed how for example Shopify asks clients to route their subdomains to a static IP. This static IP then seems to have a PTR record that points the IP to myshopify.com. I don't know what then happens internally. But it would go like this:

PTR 0.00.000.00 -> our-sub.domain.com

Not sure if any of these suggestions are possible.

Any ideas how this could be solved?

1 Answers
Related