Virtualmin behind nat, virtualhosts and everything else


Ok, i have one big problem :stuck_out_tongue:

I try to explain.

Server behind NAT router, one public ip in outside and internal static ip to server.
How to configure virtualmin properly to get everything work, emails, dns, virtualhosts etc.

If i configure network settings like that. Internal ip to apache and external to DNS records


Then DNS records are all in internal network. That means if someone in internet try to access my site it trys to reach to internal network.

Example record from bind IN A

and all other records are with same ip

Nslookup from external network and different connection.

Non-authoritative answer:

But if my web server is pointed to local network then no one can get into it. am i right ? Or how to make that they can go my internal ip server or what ?

Default IPv4 address for virtual servers is

Virtualmin could not work out the default IPv6 address for virtual servers on your system. You will need to update either the Network interface for virtual addresses or Default virtual server IP address fields on the module configuration page.

External IP address for DNS records is set to, which matches the detected external address.

Ok, i changed both Default virtual server IP address and Default IP address for DNS records to external ip.

After some waiting when dns starts to work i queryd from external network.


Super, everything works, noooot! :stuck_out_tongue: nslookup get correct ip. server external ip

Server: UnKnown
Address: (server external ip)

Address: (server external ip)

if i try to go my domain then i get to /var/www/html not to /home/username/public_html
Every domain goes to same wrong dir. What to do to get everything working properly.

This is EXACTLY the issue Iā€™m having with my setup; how did you fix it?