Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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: http://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.

Question:

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...

Update

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. :)

share|improve this question
add comment

3 Answers

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            1.2.3.4
www             IN CNAME        example.org.
*               IN A            5.6.7.8 # 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            1.2.3.4
www             IN CNAME        example.org.
gateway         IN A            5.6.7.8 # 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 5.6.7.8 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.

share|improve this answer
    
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 Mortensen Apr 2 '11 at 15:07
add comment

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:

http://httpd.apache.org/docs/2.2/vhosts/

share|improve this answer
    
Thanks, helped me understand virtual hosts :) –  DylanJones_md Apr 2 '11 at 14:27
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

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.