General discussion



By jarif93 ·
every time i ping my server internally it returns public ip address instead of local address.
the server has 2 nic.
I expect it to return internal ip address.
I am pinging it by name.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by Oldefar In reply to ping

Your confusion is in your statement "I am pinging it by name." Impossible. IP packets are always addressed by IP. This includes ICMP traffic like "pings".

Here is what happens when you issue a ping command using a name instead of an IP address.
1 - system checks to see if it has the name and IP in its host cache. If yes, it uses the IP there, if no.
2 - system generates a DNS request for the IP associated with that name. When it gets a response, it uses the IP provided in the response.

Now, since you are getting an IP to use but it is the public rather than the local address, I am fairly certain that your system is issueing a DNS querey and getting a response back with the public IP. This is good, since you want the public side to find the public IP based on name. However, it also indicates that you haven't established an internal DNS and are relying on external or public DNS.

Specific solutions for the inside versus outside DNS are OS specific. To work without an inside DNS, set up local hosts on each inside node. Again, per the OS on each node.

Collapse -

by jhoup In reply to ping

If you are only worried about your computer pinging the server with the internal address by name, you can modify the hosts file on your PC.

The hosts file is located in:

example: localhost Servername

If you want this on all of you workstations, you will need to:
a) Do the same step above on all systems
b) Install an Internal DNS Server (Preferred)

Related Discussions

Related Forums