• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Mapping internal an external IP address

D

DCR

Guest
Mapping internal and external IP addresses

I searched through the forums, and seem to only find other threads where people are confused. No real answers to this issue. I am really hoping that I just missed something, and someone can set me straight.'

Issue:

Server is behind a Cisco firewall, and hence uses internal IP addresses, which is mapped through the firewall using NAT.
This means that for hosting to work, I have to select an Internal IP (like for example 10.0.0.1) as the hosting IP.

However Plesk then automatically assumes that the new domain or subdomain should also have a DNS that matches, which of course does not work. The internal IP cannot be announced on external DNS. The external IP should be.

This means that every time I define a new domain/subdomain, I have to hurry into the DNS config and manually change the A and PTR records and any other uses of the internal IP from internal to external IP.

Hard coding the DNS template from showing '<ip> to containing a fixed IP address does not work either for multiple reasons:

a) I have multiple external and internal IPs. Hard coding template to just one of them will not work.
b) Apparently the template is not always used. Creating alias domains or subdomains, the internal hosting address seem to be used suddenly. The Plesk created DNS has the internal hosting IP in it, and not the DNS zone template's hard-coded IP.

If I remember to to change the DNS immediately as a work-around, not a big issue. However, if I forget and try to access the new (sub)domain from outside the server before fixing the Plesk created DNS, suddenly the Internet has this invalid internal IP cached. Even after I fix it, I have to wait for the caching to die to be able to access the site.

Soooo... Here is what I would really like as an add-on in Plesk to support servers behind firewalls:

In the server "IP address" section, it would be great, if there was a mapping function, where the assigned hosting IPs could be mapped directly. When Plesk sets up the new domain, it should then use the assigned internal IP (like 10.0.0.1) for hosting, but automatically know to map the internal IP to a corresponding external IP before sticking it into the DNS configuration.

This way the DNS would be set up correctly from the beginning, and the DNS zone template could stay at its default using '<ip>' notation. Except that the '<ip>' would be replaced with the mapped external IP, rather than the hosting IP (the internal address).

Please tell me that this mapping function exists already, and that I was merely too thick-headed to find it. :)
 
Last edited by a moderator:
Yes. I did read it, and I changed my DNS template a long time ago to have a public IP as default, instead of the standard template's <ip> entries. But that hard-coded address is only occationally correct.

Thats why I mentioned earlier, that I have more than one IP and changing the DNS template will not work. Stuffing a hard-coded IP into the DNS template works only for simpler server setups with only that one IP address assigned.

Two things happen in Plesk.

a) The DNS template is apparently only used when creating a new web-space. Not sure. I have this evening added multiple new parallel domains into an existing web-space. Not as domain aliases, but using "Add domain" button. In all cases, the initial newly added DNS showed up with the internal address (the hosting IP), rather than the hard-coded default external address from the DNS template. Not sure why.

b) Hard-coding the DNS template to a single fixed external IP as described in your Administrator Guide only works for simple server setups with a single IP in use.

In my case, as probably for many others out there, the firewall maps multiple external IPs onto each of multiple internal IPs.

What is needed is a mapping table type thing, that maps something like

Hosting IP External DNS IP
---------- ---------------------
10.0.0.1 -> 001.002.003.004
10.0.0.2 -> 005.006.007.008
10.0.0.3 -> ..........

Plesk should then pick the right external IP for the DNS, based on which initial hosting IP was selected for the hosting.
If this is not done, the incoming connections hits the wrong internal IP, and will not go to the expected vhost setup. The web-connections fail.

So, in short. Hard-coding the DNS template does not work because the template is apparently not always used in Plesk, and even if it was, that does not work for machines with more than a single IP.
 
Why not allocate a public IP to the hosting server, and got rid of the natting? Wouldn't that be all-around more flexible? I'm just curious. It would remove an awful lot of headaches at any rate :)

Faris.
 
As mentioned, the server has a heavy firewall in front of it.

Actually irrelevant, since Plesk should be able to handle such standard setups. It is only a tiny piece of code to implement it, and most standard hosting setups involving firewalls will include natting. So not supporting that mapping in IP allocation and DNS setup makes no sense.
 
Back
Top