How to ping a computer if the computer name starts with dash "-"
+12
A:
On *nix, use a "--" to allow an argument beginning with a dash:
ping -- -funkyhost
(This probably won't help on Windows, though, because Windows command-line parsing is kind of rudimentary)
On another side note, well-formed DNS names are not allowed to start with a hyphen.
Andrew Medico
2009-03-23 02:09:21
+1 for noting that valid RFC-compliant hostnames cannot start (or end) with a hyphen.
tvanfosson
2009-03-23 02:30:11
Same with _underscore_, you can have it in a Windows computer name, but it's not an RFC-compliant host name, so I stay away from using it.
Bratch
2009-03-23 02:50:04
+2
A:
On Windows:
Try escaping out the dash with a backslash ('\') character:
ping \-<hostname>.<domain>
LeopardSkinPillBoxHat
2009-03-23 02:09:44