Need opinion - Domain Parking with VirtualMin

I have around 30 domains which I would like to park on my VirtualMin server.

a. I need to create DNS records for each domain (A record only)
b. Point all the domains to same document root under Apache

How should I do the same? Do I need to create multiple virtual servers (for each domain I want to park)?

Howdy,

There’s a few different ways to do that… but one simple way would be to create an alias server for those domains.

You can do that by going into Create Virtual Server -> Alias of example.com.

-Eric

Eric, thanks…

I have a couple of followup notes:
a. I created my first virtual server abc.com and added a few pages, site works fine
b. I added pqr.com as alias of abc.com. when I visit pqr.com, abc.com shows up.
c. If I open my server hostname (a.com), it shows up abc.com

I am concerned about point c. Why is that happening?

Howdy,

If you browse to a domain that points to your server, but doesn’t have a Virtual Server setup for it – it’ll show the default domain.

What you might want to do is setup a default website that users will see if they browse to a domain with no website setup for it.

To tell Apache a website is the “Default”, go into Server Configuration -> Website Options, and set “Default website for IP address” to “Yes”.

-Eric

Makes Sense, I will work on adding another site and making it the default one.

I have more than 100 domains which I would like to park (create alias). Does Webmin/ VirtualMin have a way to setup aliases in bulk or through the shell?

I am not quite comfortable with the idea of manually adding each domain one after the other. Very monotonous and time consuming.

Any thoughts/ suggestions?

Howdy,

You can add them using the command line if you like… you can see all the possible options for creating a Virtual Server by running the command “virtualmin create-domain”.

An example of how to create an alias would be to use this command:

virtualmin create-domain --domain example.com --alias foo.com

If you have 100 domains, you can write a bash script that loops over all 100 domain names, and calls the above virtualmin command for each one.

-Eric

I will check that out, thanks!

Command line is a great supported feature. How can we simply add aliases? The above option asks us to create domain with aliases.

Howdy,

You can use the Virtualmin command line to create aliases, though you do need to have an existing domain name for it to be an alias of.

So, if you have an existing Virtual Server named “existing-domain.com”, and you want to add an alias server named “alias-domain.com”, you could do so using this command:

virtualmin create-domain --domain alias-domain.com --alias existing-domain.com --default-features

virtualmin create-domain --domain alias-domain.com --alias existing-domain.com --default-features

Should’nt it be
virtualmin create-domain --domain existing-domain.com --alias alias-domain.com --default-features?

Well, I ran a test of that before posting it, and that worked for me… but I do suppose it’s possible I got the parameters mixed up when I copied it in here :slight_smile:

It’ll throw an error if it isn’t correct – so give it a try and let us know what works for you :slight_smile:

-Eric