Hosting custom domains with IP address flexibility

Posted by F21 on Server Fault See other posts from Server Fault or by F21
Published on 2012-12-10T00:40:18Z Indexed on 2012/12/10 5:08 UTC
Read the original article Hit count: 427

Filed under:

I am building a small service where users will be assigned a subdomain such as:

myusername.myservice.com
anotheruser.myservice.com

I know that I can set up a wildcard vhost and using some configuration regex, serve the files like so:

myusername.myservice.com        ===> /var/www/myusername
anotherusername.myservice.com   ===> /var/www/anotherusername

The problem is that I would like to allow users to alias their own domain names to their service.

I understand that for the webserver, once the user adds the domain via my web interface, I can easily create a vhost for the domain in nginx and then refresh the webserver.

The problem is that I would prefer to NOT let the users add an A record of my webserver's IP address as I would prefer to keep things flexible (when we upgrade our infrastructure to something more complex to scale).

What is the best way to achieve this?

© Server Fault or respective owner

Related posts about dns