What is the best method to determine an account through DNS A record configuration?

I apologize if my description of the problem is unclear. I am working for an online CMS that allows external domains to be used similar to Tumblr or Flavors.me. I noticed both of these services simply require you to add an A record to your domain's DNS.

When trying this, I added an A record for a blank name and "www" both leading to my webserver's IP. While this successfully routes to my server, it doesn't retain the used domain. This leaves me without any idea of what account they're attempting to reach at the application layer. I'm using nginx as my webserver.

I have changed all the nameservers for a domain before, and that works properly, however that causes complications with other issues such as mail and isn't feasible on a scaled solution.

What should I be doing here? Is the A record the correct method of accomplishing this? How are sites like Tumblr and Flavors.me determining which account is being referenced by the domain?


You most likely only want to have people create an A or CNAME record for a subdomain on their domain that directs to your server IP address (A record) or hostname (CNAME). It isn't necessary to use subdomains, but you need to offer the option.

Your server then serves content based on the request it received, just as you might serve multiple sites from the same server. In Apache you might use separate vhosts or, more likely in your scenario, your CMS serves different content based on the properties of the request. You just need to figure out how the platform your CMS is on can access the different parts of a request, and then pass that to the logic that pulls the content.

If you make your question more specific to include the language/framework/platform the CMS is built in you may get more specific advice. Or try posting to Pro Webmasters or Stack Overflow where you may find people with more specific experience doing this.