Multiple Domains on one IP

Good day,

I have a question about Virtualmin which the documentation is not clear about, I want to host multiple domains such as XYZ.co.uk and ABC.co.uk but I only have one external IP, can I set up multiple domains in Virtualmin and direct traffic based on the domain?

I cant do it at the router level as it does not support doing this.

Thanks

Yes.
I have 33 VS (domains) on one of my VM (it has only one IP)
I also have one VS (domain) on a single VM (IP)

you can do whatever you want.
(I don’t use a router) I use boxes provided by various providers/locations (eg Digital Ocean, Linode, Ionos, Gandi etc etc…)

Your router will pass all traffic to the Virtualmin server. Do you see a DMZ setting in the control panel of your router?

Of course. That’s what the “virtual” in “Virtualmin” is about. It’s basically named after VirtualHost in Apache (and virtual map in Postfix).

maybe too much technical details – one item that makes this work for https connections using a single IP is SNI – Server Name Indication – fully supported by apache (and nginx) and Virtualmin for many years now.

I too have several servers managed with Virtualmin that each have a single IP while supporting 10-15 different domain websites on each server.

Do not use DMZ this is incredibly dangerous. Forward the specific ports only.

A dual firewall design for DMZ is cited to be more secure as traffic is controlled and filtered at both ends: at the front end, where traffic from external sources flows into the DMZ, and at the back end, where traffic from the internal network to the DMZ flows. Dual firewalls mitigate the risk of encountering the same security vulnerabilities.

If you DMZ to Virtualmin I can’t see a issue as virtualmin is fully firewalled.

DMZ can lead to mistakes.

Never heard of a dual firewall design that uses DMZ. DMZ forwards all traffic to one IP bypassing all rules except for packet inspection.

Yes, you can host multiple domains, using Virtualmin with only one external IP address. Virtualmin supports name-based virtual hosting, which allows you to direct traffic to different domains based on the domain name, not the IP. When traffic arrives at your server, the webserver (like Apache or Nginx) can distinguish which domain the request is for and serve the corresponding website.

Make sure you set up the virtual servers for each domain in Virtualmin, and it will handle the rest. No need to configure anything at the router level.

I run a debian 12 server on an old dell laptop in the DMZ of my LAN router, which is connected to the router of my ISP. On this server I run a virtualmin instance with nextcloud as my private cloud. The performanc of this 10 year old laptop is about 80 % of any cloud VPS.
Of course you need to have some knowledge about firewalls, port forwarding and natting. But I would say it is basic and absolutely doable. The only thing I am missing is mailing on my private hardware.

= SNI (Server Name Indication)

SNI is not the same as name-based virtual hosting, but it is required for HTTPS to work for name-based virtual hosts. The VirtualHost feature in Apache was introduced long before SNI existed, and it could support SSL (or, now, TLS) on VirtualHosts on different IP address. SNI enabled many name-based hosts on one IP.

1 Like