0

I'm calling code like this, and it gives good info:

    string hostName = Dns.GetHostName();
    IPHostEntry ipHostEntry = Dns.GetHostEntry(hostName);

Here's the data:

  • [0] {fe80::d2f:b4c7:e592:9612%18}   System.Net.IPAddress        AddressFamily       InterNetworkV6  System.Net.Sockets.AddressFamily
    IsIPv4MappedToIPv6  false   bool        IsIPv6LinkLocal     true    bool
    IsIPv6Multicast     false   bool        IsIPv6SiteLocal     false   bool
    IsIPv6Teredo        false   bool        ScopeId 18      long
    
  • [1] {fe80::1ef:a74b:40eb:79f2%19}   System.Net.IPAddress        AddressFamily       InterNetworkV6  System.Net.Sockets.AddressFamily
    IsIPv4MappedToIPv6  false   bool        IsIPv6LinkLocal     true    bool
    IsIPv6Multicast     false   bool        IsIPv6SiteLocal     false   bool
    IsIPv6Teredo        false   bool        ScopeId 19      long
    
  • [2] {172.31.14.146} System.Net.IPAddress        Address 2450399148  long        AddressFamily       InterNetwork    System.Net.Sockets.AddressFamily
    IsIPv4MappedToIPv6  false   bool        IsIPv6LinkLocal     false   bool
    IsIPv6Multicast     false   bool        IsIPv6SiteLocal     false   bool
    IsIPv6Teredo        false   bool
    
  • [3] {172.28.255.138}    System.Net.IPAddress        Address 2331974828  long        AddressFamily       InterNetwork    System.Net.Sockets.AddressFamily
    IsIPv4MappedToIPv6  false   bool        IsIPv6LinkLocal     false   bool
    IsIPv6Multicast     false   bool        IsIPv6SiteLocal     false   bool
    IsIPv6Teredo        false   bool
    

But there's no indication on the IPHostEntry of where the adapter connects. Here's the IP config from CMD:

C:\Windows\system32>ipconfig

Windows IP Configuration

Ethernet adapter Ethernet 12:

   Connection-specific DNS Suffix  . : inside.1-stop.biz
   Link-local IPv6 Address . . . . . : fe80::d2f:b4c7:e592:9612%18
   IPv4 Address. . . . . . . . . . . : 172.31.14.146
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 172.31.14.254

Unknown adapter OpenVPN TAP-Windows6:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::1ef:a74b:40eb:79f2%19
   IPv4 Address. . . . . . . . . . . : 172.28.255.138
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

I don't want the VPN one...

Andy
  • 67
  • 1
  • 7

0 Answers0