'What's the best class to store the network identity of a computer in .net?

On Windows, a computer can be located using its Netbios name, DNS name, IPv4 or IPv6 name.

Is there a built in class in the .net Framework that can aggregate all these ways of identifying a computer?

The Uri class can detect DNS, IPv4/v6, but I would have to specify a "fake" scheme if I wanted to use it and I'm not sure it's the best way to go.



Solution 1:[1]

Sorry for misunderstanding. IPHostEntry mostly used to store such data in .NET Framework. But it's not very rich for functionality.. Own custom class may be an better solution...

Solution 2:[2]

IPHostEntry is probably not quite correct to use for storing IP or hostname. Because it is a "live class", the data will be dynamically filled.

I think the DnsEndPoint class will be optimal for use

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rufanov
Solution 2 KUL