: DNS provider for unlimited subdomains with api access? I have a project in mind that will offer users their own domain, like tumblr does for example. I want to find a provider that can provide:
I have a project in mind that will offer users their own domain, like tumblr does for example.
I want to find a provider that can provide:
One top domain. eg: myproject.com
Unlimited subdomains. eg: a.myproject.com, b.myproject.com, ...
An API to create subdomains automatically
At a reasonable price (if possible).
More posts by @Speyer207
2 Comments
Sorted by latest first Latest Oldest Best
Creating individual A records for each account is one method. I worry about the propagation possibly being delayed.
In my zend application when users register they are asked to choose a user name, that name becomes their sub-domain name where they login. username.myapp.com The username is placed into a file /etc/nginx/subdomains
There is a perl script in the Nginx conf folder that reads the list of subdomains from the file and enters them as server names or aliases I forget which. Nginx is then reloaded with nginx -s reload this reloads the configuration files only, nginx (the web server) never goes down. So before the users even get to activating their email address and logging in their sub-domain is ready without having to use DNS records.
The application does validation when a user logs in at their domain it checks they are logging into their assigned sub-domain.
With this if people enter a sub-domain that doesn't exist they see a custom 404. Similar to if you go to asdfasdfasdfasdfa.zendesk.com/
If my application ends up with 100,000 users I rather not have to worry about 100,000 A records and simply work off a local database and file to manage the sub-domains.
If your DNS provider supports wildcard records, then you just need a web host that supports arbitrary subdomains with name-based virtual hosting.
This is a perfectly fine and scalable way to set up a family of subdomains. For example, it's what StackExchange does: they just have a single wildcard DNS A record for *.stackexchange.com, which (currently) points to 64.34.119.12. The webserver running on that address then looks at the HTTP Host header to decide which site to serve.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.