title: How do I determine the local host’s IPv4 addresses?
body: <p>How do I get only <a href="https://en.wikipedia.org/wiki/IPv4" rel="noreferrer">Internet Protocol version 4</a> addresses from <code>Dns.GetHostAddresses()</code>? I have the code below, and it gives me IPv4 and IPv6 addresses.
  I have to make it work with boxes that have multiple IPv4 addresses.</p>
  
  <pre><code>IPAddress[] localIPs = Dns.GetHostAddresses(Dns.GetHostName());
  private void get_IPs()
      {
          foreach (IPAddress a in localIPs)
          {
             server_ip = server_ip + a.ToString() + "/";
          }
      }
  </code></pre>