Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reverse IP Lookup in C#/.NET

Status
Not open for further replies.

Quimbly

Programmer
Oct 24, 2002
33
CA
I'm developing a firewall log monitoring application in C#
with the .NET framework, and I can't figure out something.
I'm trying to do a reverse lookup on an IP address. I
don't mean reverse lookup to a DNS entry. I'm looking to
find out the computer-name behind the IP address.

The only thing I can find that's remotely related is:
Dns.GetHostByName() and Dns.GetHostByAddress().
However,these methods deal with IPHost objects, which only
contain DNS or IP information -- nothing about computer-
name.

Does anyone have any idea how to get a computer-name from
an IP address in my C#/.NET application? Is there anything
in .NET that will accomplish this? If so, what is it? If
not, what can I call outside of .NET that I can
incorporate into my application?

Thanks!

 
I really should be using better terminology.

What I'm looking for is a fully-qualified domain name for any IP address.

Basically, I need to have my app do what an NSLOOKUP does for an IP address.

For instance, when I perform an NSLOOKUP on my IP address, I get: clgr00xxxx.hs.telusplanet.net (where xxxx is four digits everyone doesn't need to know).

GetHostByAddress() is the only method I can find in .NET that is remotely related, but unfortunately, it doesn't work. Calling this method with my IP address (or others) returns no DNS at all.

I need to have this facility in my application. Does anyone know of anything else in .NET, or something outside that I could import, to get this accomplished?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top