Equivalent of Linux command `hostname --fqdn` in Windows XP?

Solution 1:

There is no such option to the hostname command in windows. However, this should do the trick:

echo %COMPUTERNAME%.%USERDNSDOMAIN%

Or you can grep (under Windows: find /I "string") for Host- and Domain from set or systeminfo or ipconfig -all name and glue it together elsewhere.

Edit: fixed Typo. Thanks Benoit

Update: The variable %USERDNSDOMAIN% is only available when logged on to a domain... The DNS suffix you get from a DHCP server is not put into a environment variable (as far as I could figure out).

Solution 2:

You can find it in the system properties ("Computer name" tab).

With the command line, you can run IPCONFIG /ALL and have a look at the "Host name" and "Primary DNS suffix" fields.


Solution 3:

The command is:

ping -a localhost