This question is related to Given a Uri value how can one check whether it refers the local machine?, which did not see a satisfactory resolution.
My need is simple, I want to discover the IP addresses (may be more than one if there are multiple network cards) as well as the host names of the local machine without making any network round-trips. Meaning only the information appearing in the local tables, no DNS queries. BTW, the domain names must be discovered as well.
On second thought, I can do with the following method:
bool IsLocalAddress(string address);
Which accepts IP, host name or host + domain name and returns true iff the address refers the local machine. Again, please take into account multiple NICs and domains.
Thanks a lot in advance.
P.S.
I prefer C# code samples.