how to get domain name of a remote computer

  • Thread starter Thread starter Hakki
  • Start date Start date
H

Hakki

We need to resolve with which computer my computer is communicating. We
write a sniffer that gets pakets and so we resolve ip addresses and now we
need to get their domain names.
I think we need to use netbios protocol but I dont know how. How can we do
this ...
 
Hakki,

Are you referring to the DNS name of a machine, or are you referring to
the windows domain name on a local intranet?

If the case is the latter, then you can call the static GetHostByAddress
method on the Dns class in the System.Net namespace.

If it is the former, then you might have to call the gethostbyaddr
function in the WinSock 2 library in order to get this (as it can return an
NETBIOS name). From there, you should have no problem getting the domain
name.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top