Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have an app that sits at It's a rails application sitting on an Apache/Passenger stack.

The app is set up to use subdomain constraints to point to user accounts (e.g.

I want users to be able to point their own domain at their subdomain transparently.

so points to

I have set up an A record for to point to my server. I've set up a DNS zone with A record for to point to the server.

On which zone to I put the CNAME record?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Not sure exactly what your setup is but you could do this one of two ways. You can certainly create CNAMES for each account but if you know your domain is only going to be used for client accounts simply setup a wildcard CNAME so * then any request, regardless of the subdomain will always point to your application. You app would have to be smart enough to figure out what user is logging in but you get the idea.

Your CNAMEs should always be hosted in your DNS zone. However, I would actually recommend just creating A records for this. So you might have the following:

- A       ->
- A ->
- A *     ->

It saves on a secondary lookup to resolve the first domain and then resolve the A record for your domain as well.

Your clients could then simply create a CNAME in their DNS zone to point to

Hopefully that all makes sense.

share|improve this answer
Would you change your recommendation if I told you that I (as in my code) was solely responsible for setting up the DNS zone for the subdomain, AND creating the zone for All the zones are in my linode DNS manager. I'm sorry for trying to be vague about the idea (NDA). The users subdomains were used as an example. So just to reiterate when an account is created, my code connects to the Linode DNS API. Creates a zone for the domain my customer provides (and owns) and the records. So if my client enters, visiting that should show – Brandon Cordell Aug 21 '12 at 16:16
Not much really changes. The only thing that really changes is that you would then create a DNS entry either CNAME or A, doesn't matter for each customer as you describe. Is there a specific part you are still confused about? – Brent Pabst Aug 21 '12 at 16:26
Where should the CNAME go? In the main zone ( or the customer's domain's zone? – Brandon Cordell Aug 21 '12 at 16:30
Potentially both. If you want to setup to point to you need to setup a CNAME or A record in your zone. However, if the customer wants to then map to they would also need a CNAME. – Brent Pabst Aug 21 '12 at 16:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.