Un-Managed Parked Domains # SOLVED #


I have a requirement where I need to add several (up to 100) parked domains to a single main domain, none of these parked domains receive emails, the web pages are dynamic and each parked domain will be served from the same document root, only the page content will change depending on the detection of browser’s domain / host name.

This basically means that I have just one site to maintain with the control panel, there’s only one or 2 dns entries (www.domain.com, domain.com) per domain and there is no requirement at all to manage or maintain any settings for them individually through the control panel.

This has been working well on other control panels for a few years, but having migrated to virtualmin, and can’t seem to find an easy way of doing this.

To add an alias for each one, means that instead of having one master virtual domain in my drop down menu for the virtual servers, I would have for example 101 names, 100 of them parked and the 1 main domain, but none of the parked domains will ever be accessed and it’s really pointless having them in the drop down ?!

So other than adding 100 alias’s as virtual servers, since none of them require any form of management or configuration via virtualmin, is there a better way of doing this ??

Can I somehow list all of the TLD domains in BIND (mydomain.com), and use a wildcard server using apache, with maybe mod_rewrites to take care of the sub domains such as (www.mydomaon.com > mydomain.com) etc.

Any help / suggestions gratefully received as I have been tearning my hair out for about a week now trying to come up with a solution !



After lots of googling and some hacking, have managed to achieve what I wanted.

you described your issue in length, but not publish your solution ?


Well as I did not get any replies and did not find any related posts and very little on google, I’d assumed that it was just me that needed to do this :slight_smile:

Anyway, it’s pretty simple really, all you need to do is to create a master zone for the parent domain (the domain you are going to park the children on) in the /var/named folder, and then create entries in the /etc/named.conf file for each child domain, referencing the parent zone.

In the Master Zone, you do not include the domain name for the A records, MX records etc, also should be replaced with the IP address to be used for hosting the parent domain.

$ttl 38400
@    IN    SOA    ns1.parent.com. root.parent.com. (
   38400 )
@    IN    NS    ns1.parent.com.
@    IN    NS    ns2.parent.com.

@    IN    A
www    IN    A
ftp    IN    A
m    IN    A
localhost    IN    A
webmail    IN    A
admin    IN    A
mail    IN    A
@    IN    MX    5 mail.parent.com.
@    IN    TXT    "v=spf1 a mx a:parent.com ip4: ?all"
zone "child1.com" {type master; file "/var/named/parent.com.parked";};
zone "child2.com" {type master; file "/var/named/parent.com.parked";};

Alternatively, you can create a separate file to list all of the domains, which is what I did, I placed this file in the home directory of the parent domain:

include "/home/parentid/parked.hosts";
zone "child1.com" {type master; file "/var/named/parent.com.parked";};
zone "child2.com" {type master; file "/var/named/parent.com.parked";};

But you will also need to add the ‘bind’ user to the parentid group or otherwise BIND will not be able to access the file, alternatively you could place the file in the /etc folder and then you should not have problems with access rights.

I also found that I needed to create the parent file in addition to the default zone created for the parent zone using virtualmin, and with a different name, as otherwise the virtualmin backup fails with and error about not being able to find the apache virtual server for that domain.

But as always, this info is provided as is without any guarantees, if you decide to use it you do so at your own risk.

Hope that helps someone :slight_smile:


I also would like to keep these “parked” domains out of the drop down list used to select domains in Virtualmin.

Your approach appears to work well, but it is a bit more labor intensive to setup each parked domain, because it isn’t done from within Virtualmin. At first I was thinking that a Virtualmin module could possibly be added to manage these parked domains.

As an alternative, I thought perhaps Virtualmin could be adjusted so it would skip these domains when building the list. Some options in Module Config to control what is shown in the list (i.e. “parked” domains, autoaliases domains, alias domains, etc) in Virtualmin would be a great addition. I suggested it as a feature, and Jamie apparently thinks it’s a great idea.

So, it looks like soon we’ll be able to manage parked domains much easier, right from within Virtualmin.

Too bad most software vendors aren’t as responsive and quick to implement feature requests as Jamie and Joe are!