I am trying to figure out how to allow my users to use a CNAME for their unique wildcard domain. (user1.wlapi.com), etc

I read here: https://stackoverflow.com/questions/5101195/custom-subdomain-with-cname-problem

That using a wildcard DNS for CNAME's may not be the best, so I would need another way to identify the user, thats fine. I can do that with some database work.

However, I can't seem to get the CNAME to work with user1.wlapi.com OR wlapi.com

It just doesn't do anything... just loads up a blank screen.


What do I have to do to allow for CNAMES to work on my server? (I am using MediaTemple, but I can switch if there is an easier host for this)

I read something about .conf files with VitrualHost but that doesn't make any sense to me...


I got it working! I upgraded to dedicated server with a unique IP, and that seem to work.

The wildcard DNS does not work, but I can I just use the HTTP host to find the user. :)


There are 2 main ways to go. For the sake of making an example, let's say your company name is example.org :

a) Per account subdomains under your domain: All your users get a Fully Qualified Domain Name under your domain, i.e. <userid>.example.org , <nextuser>.example.org. I would do this with a catch-all A-Record:

$ORIGIN example.org.
@               IN A  
www             IN CNAME        example.org.
*               IN A   # This one

b) "Vanity domains" going to a dedicated gateway: Say you want to offer your en users the option to set up a FQDN in their own domain, like shop.userdomain.com. In that case, I would dedicate a gateway server to handle this, and let the users create CNAME's to this gateway. Something like:

$ORIGIN example.org.
@               IN A  
www             IN CNAME        example.org.
gateway         IN A   # This one

.. and your end users must create a CNAME pointing to gateway.example.org in this example.

Notes: In both cases above I'm using A-Records, but you can also use CNAME's if that's more convenient. And your server must look at the incoming HTTP headers and act appropriately, i.e. your programming of your webapp needs to handle the user accounts right on a per-request basis.

  • Hey Jesper, the settings you explained... where do I add this? Sorry, I am a complete n00b with server stuff. :) Is there a file I am editing for this? – DylanJones_md Apr 2 '11 at 13:43
  • @DylanJones_md: I tried to explain the DNS side of the solution (DNS: The system that translates from your domain name to the IP address your server has, i.e. the global addressbook that leads user requests to your server). My examples are in BIND syntax, which you're probably not using directly -- you're probably using GoDaddy, Mediatemple or someone else to host your domain DNS for you. If you're so new to all this, perhaps you should consider hiring a consultant to accelerate the setup of this. :-) – Jesper M Apr 2 '11 at 15:07

In IIS in Windows you would use host headers. In Linux I believe it's called a Virtual Host, as you stated. Here's a link that explains it:



As others have stated it's a two step process, involving your content DNS server and your content HTTP server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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