Virtualmin behind nat, virtualhosts and everything else

hi

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 192.168.178.33 and external to DNS records

screenshot http://upload.e-suits.eu/images/2013/10/29/shot_131029_224426.png

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

domain.com. IN A 192.168.178.33

and all other records are with same ip

Nslookup from external network and different connection.
C:\Users\Admin>nslookup domain.com
Server: dns.estpak.ee
Address: 194.126.115.18

Non-authoritative answer:
Name: domain.com
Address: 192.168.178.33

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 192.168.178.33.

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 xxx.xxx.xxx.xxx, 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.

nslookup domain.com

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

C:\Users\Admin>nslookup domain.com
Server: UnKnown
Address: (server external ip)

Name: domain.com
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?