I am running a server, and I want to display my own IP address.
What is the syntax for getting the computer\'s own (if possible, external) IP address?
Someon
Yet another way to get your public IP address is to use OpenDNS's resolve1.opendns.com
server with myip.opendns.com
as the request.
On the command line this is:
nslookup myip.opendns.com resolver1.opendns.com
Or in C# using the DNSClient nuget:
var lookup = new LookupClient(new IPAddress(new byte[] { 208, 67, 222, 222 }));
var result = lookup.Query("myip.opendns.com", QueryType.ANY);
This is a bit cleaner than hitting http endpoints and parsing responses.