I have code that works fine on IPv4 machines, but on our build server (IPv6) it fails. In a nutshell:
IPHostEntry ipHostEntry = Dns.GetHostEntry(string.Empty);
The documentation for GetHostEntry states that passing to string.Empty will get your local host IPv4 address. This is what I want. The problem is that it returns the string ":: 1:" on our IPv6 machine, which I believe is the IPv6 address.
A pinging machine from any other IPv4 device gives a good IPv4 address ... and makes a "ping -4 machine name" from itself, gives the correct IPv4 address .... but regularly pings it from itself, it gives ":: 1:".
How can I get IPv4 for this machine from myself?
zombat Jun 29 '09 at 17:38 2009-06-29 17:38
source share