Lionel
Lionel

Reputation: 2029

Customers are pointing their domain to our fix IP (web server). How to reroute via CNAME?

We have a web platform that is used by customers from all over the world. We also offer a white-label solution where customers can use their own domain to use our services.

Many point their own domain address by:

a) setting the nameserver to ours - we then do the rest (pointing it to our IP)

b) setting A records to point our fix IP address X.X.X.X directly (this IP belongs to a virtual apache server were our application runs).

FYI: We have full access to DNS.

We'll soon move to Amazon Web Services (Elastic Beanstalk) and are therefore preparing the transfer. During the transfer we want of course the least downtime possible resp. the domains to be showing to the new server address as fast as possible.

Customers a) are easy to handle. We simply set CNAME to point the Elastic LoadBalancer (ELB, no fix IP given thus CNAME) and they will be redirected promptly.

Customers b) though seem to be more complicated. Is there a way to reroute to CNAME -> ELB?

Example:

Given: Customer b) points his domain sub.customer.com directly to our IP X.X.X.X.

What we did: In DNS we opened a new hosted zone for "customer.com" and put CNAME -> ELB for sub.customer.com.

This does not work. What can we do to have sub.customer.com redirected to CNAME (ELB) without changing URL? Maybe with .htaccess or with other DNS modifications?


PS: We are doing this because we can forsee that lots of customers will take ages to change from "A record -> old IP" to "CNAME -> new ELB".

Upvotes: 0

Views: 267

Answers (1)

John
John

Reputation: 727

If the customer controls the A record, the customer must change the A record. In this case, the customer most likely controls the NS records upstream as well, so nothing you do on your DNS servers will have any impact at all on the customer's actual domain. You can redirect at the IP level using a tool such as ipf (Debian family) or iptables (Red Hat family) or it's equivalent, but you will have to be very careful in just how you implement that.

Upvotes: 1

Related Questions