I know I can ping a server name and determine the IP address. But are there commands I can use to determine the subnet? I'm using Windows XP.

4 Answers 4


No. Subnetting is generally hard/impossible to determine from afar - why do you need it?

Strictly speaking, you don't determine the IP address of the server using ping either - ping just uses the normal resolver to determine the IP address and prints it out before going on to do its main task, testing whether a host is up by sending an ICMP echo request message and awaiting ICMP echo reply messages.

A tool that's actually built to find name mappings from DNS is host, or, more recent, dig, from the BIND DNS server client tools. Dig is a fantastically useful tool and every sysadmin should be able to use it.

Bonus information: You can find out who owns the IP block to which the address belongs and how big it is using whois on an IP address, just like you would on a domain.

  • My company is asking what subnet to put a new server on. So, I want to put it on the same subnet as another computer that I'm familiar with, but don't have access to login to. Fortunately, I can find this info in a directory that is maintained manually.
    – Jim
    Jun 9, 2009 at 12:38
  • Are you sure that the new server needs to go on the same subnet as the existing one? Unless you are doing anything specific with link-local broadcast or multicast applications this may not be the case? Jun 9, 2009 at 17:20

Write a script to psexec ipconfig on the remote server and parse the output for the subnet mask.

  • +1 for creativity, assuming he has the rights on the local server to run the psexec script. Jan 15, 2011 at 18:56

With some trial and error, you can use "tracert" from the command line to ping neighboring IP addresses to see where the route ends up. That is, assuming there's no firewall blocking ICMP requests.


If the second-to-last IP stays the same, you're in the subnet. Of course, with NAT and the fact that many hosts block these requests, you're probably out of luck.


In theory a type '17' ICMP (ping) request should work for you, but I don't know how widely supported this is anymore.



ICMP Address Mask Ping (-PM)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.