How can I direct an external domain to multiple different internal domains

Hi all,

My set up.

Virtualmin with its DNS handling internal domains such as

I have an external domain called

What I want to do is when someone types in it comes to one of the internal domains, and the only differentiators I can think to use are port numbers like this… -> -> ->

Is this possible to achieve via the virutalmin gui?

I would like to stay away from programmatic redirection and have it operate more like a serveralias where would actually be a true representative of for instance.

Thank you.

What I have done so far.

Signed up for a dynamic ip that supports wild cards.

created x.dynamic.ip, y.dynamic.ip, z.dynamic.ip

and in /etc/apache2/sites-enabled/ I inserted a serveralias x.dynamic.ip

and in /etc/apache2/sites-enabled/ I inserted a serveralias y.dynamic.ip

and in /etc/apache2/sites-enabled/ I inserted a serveralias z.dynamic.ip

This works but I had to manually edit each conf.

When I tried to create an alias via the interface it did not insert any serveralias line. It did create an un-needed directory under /home/ Should it have also inserted the serveralias line for me as well?

When reading your first post, I was also going to suggest subdomains under your “” to differentiate, instead of port numbers, yes. :slight_smile: Port numbers would have worked too, but you’d have to make manual modifications to your sites then, adding mod_rewrite directives.

Virtualmin has several methods of creating the alias domain. You can configure them in the Server Template, section “Apache Website”:

[code]Create alias websites by…

  • Creating Redirect virtual host
  • Creating permanent Redirect virtual host
  • Creating ProxyPass virtual host
  • Adding ServerAlias to parent[/code]

So if you don’t see a ServerAlias directive in the parent after creating an alias server, you probably have some other method selected there. :slight_smile:

The “un-needed” directory you mentioned was discussed in another thread just a few days ago. It is/was meant for possible email redirects that the alias domain might have, but Jamie noticed that it’s not really necessary to create that directory and will remove that behavior in a future Virtualmin version. For now though, you should keep the directories there, since Virtualmin might expect them to exist.