I\'ve got some code here that works great on IPv4 machines, but on our build server (an IPv6) it fails. In a nutshell:
IPHostEntry ipHostEntry = Dns.GetHost
IPv6
lblIP.Text = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName).AddressList(0).ToString()
IPv4
lblIP.Text = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName).AddressList(1).ToString()