New customer onboarding - subdomains & CNAME forwarding

2 posts / 0 new
Last post
#1 Sun, 09/01/2013 - 01:19
superalex_3000

New customer onboarding - subdomains & CNAME forwarding

Hi everyone, I've been playing around with Virtualmin for a couple of weeks now and love it. I can't however seem to figure out how to create subdomains.

Here's my use case: 1. new customer "customer" signs up to my service 2. I use Virtualmin to create their new virtual server accessible at customer.myhostingdomain.com 2a. Virtualmin gets to work using the template I've created - puts required files in their /home/public_html directory (sourced from /etc/skel) 3. customer builds their new site by accessing the application I've loaded at customer.myhostingdomain.com 4. in their own time, customer forward requests from their domain name (www.customer.com) to customer.myhostingdomain.com using a CNAME entry.

I'm not really keen to be a domain name hoster/registrar/primary DNS if at all possible, as it isn't what I know well.

Can anyone point me in the right direction on how to do this? I've looked through this forum but struggling to work out what to "search" for!

Cheers, Alex

Sun, 09/01/2013 - 12:57
andreychek

Howdy,

It's okay if you don't want to host DNS for your customers -- that just means that your customers would need to edit their DNS settings elsewhere, and add a DNS record for 'www.domain,com' which points to your server when they're ready.

However, were you to setup your server to act as a primary DNS server, it's actually not difficult to maintain, and it may save you some trouble.

You can tell Virtualmin that anytime you setup a domain, such as "customer.com", that you want it to automatically create an alias named "customer.myhostingdomain.com" associated with that account. That would make it so that both customer.com and customer.myhostingdomain.com point to the same website.

That way, your customer can build and test their site using customer.myhostingdomain.com, and as soon as they're ready to make their site live, they can change their nameservers to point to your server.

You can technically still do that even if you aren't hosting DNS on your own server, but it's a lot more work to do so :-)

To automatically setup aliases like the above, take a look at System Settings -> Server Templates -> Default -> Virtual Server Creation, and there, you can set "Automatically create alias domain".

Also, there's instructions on how to setup your server to work as a nameserver here in the section "How do I setup nameservers for my server":

https://www.virtualmin.com/documentation/dns/faq

Topic locked