title: Returning IPv6 instead of IPv4 in VB
body: <p>I have this function which is querying the IP address. </p>
  
  <pre><code>Dim strHostName As String
  Dim strIPAddress As String 
  
  Public Function ipconfig()
    strHostName = System.Net.Dns.GetHostName()
    strIPAddress = System.Net.Dns.GetHostEntry(strHostName).AddressList(0).ToString()
  
    rtb_Output.Text = rtb_Output.Text + "Computer Name: " &amp; strHostName + Environment.NewLine + "IP Address: " &amp;strIpAddress
  End Function
  </code></pre>
  
  <p>It works absolutely fine on my Windows 7 desktop wired connection, and returns the IPv4 address as expected. 
  When I run it on my Windows 8 tablet, either wired or wirelessly, it returns the IPv6 address instead, whereas I need the IPv4 address. Do you have any ideas why, or how I can get it to return the IPv4 address instead?</p>