In a .NET application, how can I identify which network interface is used to communicate to a given IP address?
I am running on workstations with multiple network in
At least you can start with that, giving you all addresses from dns for the local machine.
IPHostEntry hostEntry = Dns.GetHostEntry(Environment.MachineName); foreach (System.Net.IPAddress address in hostEntry.AddressList) { Console.WriteLine(address); }