5

Note

Consider each subdomain as unique application instance

For information about application architecture visit

https://stackoverflow.com/questions/11272776/using-phusion-passenger-nginx-running-same-rails-app-with-multiple-instance

I am having one product going to provide to multiple clients with subdomains

www.client1.product.com to www.client100.product.com in server 1 
with some static ip (x.x.x.1).

After 100 clients server 1 reaches maximum resource load and space, so i am buying another new server putting

www.client101.product.com to www.client200.product.com with ip (x.x.x.2) ,

consider i am using premium dns hosting for adding more than 100 A records. Is there any way to automate sub domain creation, by adding corresponding server ip to the A records.

Sam
  • 195
  • 2
  • 8

1 Answers1

4

It will depend on your DNS hosting is done.

I personally use Zonomi. They have a DNS API. I can issue a request like https://zonomi.com/app/dns/dyndns.jsp?action=SET&name=mynewsubdomain.example.com&value=10.0.0.1&type=A&api_key=apikeyvaluehere to set the IP address for a new subdomain.

Another solution would be use use Route53 from Amazon Web Services (AWS). You can use the AWS JSON API or command line tool to modify DNS records at their Route53 DNS provider. The documentation for doing so is: https://docs.aws.amazon.com/cli/latest/reference/route53/change-resource-record-sets.html

Stephen Ostermiller
  • 99,822
  • 18
  • 143
  • 364