I understand sub-domains aren't supported, but...

I understand that sub-domains aren’t supported in Virtualmin, but as a person wanting to run a hosting service I want to be able to provide new customers with a free sub-domain (i.e. websitename.example.com) if they don’t already have a registered .com or other domain.

So, for example:
My hosting service’s domain name is www.example.com.
Let’s say a new customer signs up and their website’s name is “newcustomer”.
I would want to provide them with the sub-domain, newcustomer.example.com. So when anyone visits this sub-domain (newcustomer.example.com) it will bring them to their website under the virtual server I have created for them.

So, how exactly would I go about doing this? If it’s even possible, and if it isn’t possible what is an alternate solution to this slightly large problem?


It’s actually no problem at all to do that – it’s just not called “Sub-Domain” in Virtualmin.

To do that, create a new Virtual Server – and for your domain name, enter your desired domain or sub-domain.

For example, you could enter newcustomer.example.com as the domain name.

Would that do what you’re after?


I did attempt that, however, for some reason it just gives me a blank white page when I visit it.


Okay, what you’re seeing isn’t a sub-domain issue… but what it is, I’m not sure ATM :slight_smile:

What do you see if you look at the access and error logs for that domain, in $HOME/logs/ – do you see your attempt to access it in the access_log file?

If so, are any errors showing up in the error_log?


if you see a blank page after you have installed a php script, then you may want to check if php is properly installed. just a wild guess but it does occur

Hello, thank you for you reply! :smiley:

I looked at the access and error logs and both were completely empty.

Would it have anything to do with the fact that it’s a dot.tk domain?

No PHP scripts involved here, just a regular HTML document. :stuck_out_tongue:

Okay, I added an A Record to my registrar’s DNS, but now when I visit my “sub-domain” it goes to my main site and not my virtual server.

Hmm, it sounds like Apache may be directing you to the wrong VirtualHost.

You’re in luck, as I just revamped the docs regarding that very problem… take a peek here and see if this gets you on the right track:


That didn’t seem to make any difference. I think it may be something wrong with BIND. Whenever I press “Apply Zone” under the zone for the Virtual Server in question, I get the following error: “NDC command failed : rndc: connect failed: connection refused”. What does this mean?

EDIT: Nevermind, I solved the RNDC problem. It didn’t solve my sub-domain/virtual server issue though.

Sorry about the double post, but I REALLY need this resolved. Thank you!

per haps run your domain through www.intodns.com ans see if everything is okay from DNS and A records.
if your domain does resolve to your server then per haps there is a apache (path) issue for that domain.

I ran it through and everything is okay. The only things that came up where lame nameservers on my domain registrars end which I have no control over and the fact that I have no MX records (which I don’t).

EDIT: It works when I use my .com domain registered with GoDaddy, but for some reason doesn’t work with my .tk domain registered with Dot.TK. Weird. Could this be an issue with my DNS configuration on the registrar’s side?

Lame nameservers are not good. You may want to fix that if possible. Since the .com domain works, the issues are not on your server.

Thank you very much! I’ll have to contact my registrar and see if they can resolve the issue.

EDIT: I actually just remembered that I can use GoDaddy’s off-site DNS and manage my .TK DNS records using GoDaddy’s DNS server.

All problems solved!