Finding all network addresses associated with a given hostname

Scenario:

  • a server is multi-homed to a variety of networks (perhaps it is a jump box)
  • DNS has the hostname registered only on one network (the management interface, perhaps)

Problem:

  • without logging-into the server, report all interfaces currently configured, and the IP addresses in use

Question:

How would you do this for Window? On Linux?


Solution 1:

Look into the linux arp command. I hope windows has a similar command.

"ARP stands for Address Resolution Protocol, which is used to find the media access control address of a network neighbour for a given IPv4 Address."

You may need to run the arp command on each network the server is part of. If you have access to firewalls/routers those should have an arp table you can check.

You will need to know the mac address of the server's ethernet interfaces. But if you don't know those it's not that hard to find out. If the make and model of your server are somewhat unique in the network you can look it up at sites such as http://www.coffer.com/mac_find/ and match the make you find there with the one of the server.

If you do have a list of mac addresses (who does) of the server just look it up using that list.

Suffice it to say that arp also reports either the hostname or IP address (if used with -n it will not attempt to resolve).