Internal / External IP addresses

Hi,

I have a web server running Virtualmin on a private IP address behind a firewall with a public IP address.

I can't seem to get this configuration t work correctly with virtualmin. Depending on the configuration I either have 1 of 2 issues:

  1. If the virtualmin default shared IP address and default DNS IP is correctly configured, I get: Warning - errors were found in this domain's DNS records : The DNS record resolves to the IP address instead of the virtual server's IP

  2. Or, if I set the default IP to be the public IP address, the incorrect IP is used in Apache when a new domain is created. I then have to manually edit the IP address in Apache to get the site working.

How should I be configuring virtualmin for this to work.

(Note: this server originally had the public IP address as it's IP, but due to the high number of hack attempts we moved it behind a firewall.)

Thanks, Bruce

Status: 
Active

Comments

Howdy -- you may need to go into System Settings -> Virtualmin Config -> Network Settings, and in there, set "Default IP address for DNS records" to "Automatically detect external address".

Once you do that, it'll use your internal IP address for Apache, and the external IP address for DNS.

I have made the change as suggested, however I still get the following message on the DNS records of each domain:

Warning - errors were found in this domain's DNS records : The DNS record resolves to the IP address instead of the virtual server's IP

Are you seeing that error on newly created domains too? Or just existing domains?

If you have any existing domains, you may need to review the DNS records and manually correct them (which can be done in Server Configuration -> DNS Records).

If you're seeing that issue on newly created domains -- could you post a screenshot of your Server Configuration -> DNS Records screen? Thanks!

This error is on existing domains.

The DNS records are correct.

It's the warning message that's incorrect:

Warning - errors were found in this domain's DNS records : The DNS record [domainname] resolves to the IP address [public IP] instead of the virtual server's IP [private IP].

BTW, also when I changed the default IP, it asks if I want to update domains with the changed IP. This cause all custom DNS entries added to the domains to be lost.

Setting the default IP to the private IP also breaks master / slave DNS replication because the slave try to retrieve updates from the master on its private IP, but they are on different networks.

It looks to me like Virtualmin does not really support the server running behind a firewall with a different private and public IP address.

Running behind NAT does introduce some complexities, though Virtualmin should be able to work with most NAT setups.

It sounds like you may be running into multiple issues there though, so I'll start with the warning message you're receiving --

The message you're receiving indicates that this particular Virtual Server is configured with a private IP address, in place of the default shared IP address on your server.

That would mean that your router is configured to route multiple public IP addresses into your Virtualmin server, and that your Virtualmin server would also have multiple internal IP addresses setup on it.

Does that sound correct?

If that's the case, then we would need to change the IP address that Virtualmin looks for as the external/public IP for this domain.