If you ever take a look at the network topology diagram for a large organization, do it. This is enlightenment. All NAT point, firewalls and all this "black magic" allow the network to manage addresses (including protecting you) without your knowledge.
There are only three ways in which I could reliably (and reliably relative concept here) get the external address of the server IP address.
Firstly, as the gods of the network themselves (and make sure that you refer to them as gods when you ask, this will help you in obtaining information). Sometimes (not always) this is a simple mapping of the upper bytes of your IP address, while preserving the lower order bytes. Sometimes it's harder, but still follows the rules you can use. Just keep in mind that these rules are subject to change at any time.
Secondly, you have a field outside your network that you can request, and it, in turn, can tell you your IP address.
The third is to specifically connect an external DNS server (and not corporate) to receive information.
Of course, you should question the need to know your external IP address. The whole point of DNS is to not worry about IP addresses and just refer to machines by domain name.
paxdiablo
source share