Dns.Resolve Question

  • Thread starter Thread starter Jeff Petter
  • Start date Start date
J

Jeff Petter

I was wondering if anyone know how I might be able to resolve the NetBIOS workstation names (from the WINS server) into an IP address. Something along the lines of Dns.Resolve (address), but for WINS entries. I tried it out just to see, but it only works on names registered with the DNS. Man, in the amount of time I've spent digging through documentation, I could have written something to pipe ipconfig to a file and then parsed it. But I would think there would have to be a way to grab that through a documented function.

Thanks in advance for any help,
Jeff
 
Not sure if this is what you are looking for; this will give you the ip addresses that are bound to the current dns name..

hope it helps

~harri
weblog: http://www.harrisreynolds.net/weblo

string hostName = Dns.GetHostName()
IPHostEntry hostEntry = Dns.GetHostByName(hostName)

//Return the first on
foreach(IPAddress ipAddress in hostEntry.AddressList
Console.Out.WriteLine( ipAddress.ToString() );
 
Thanks, but I had tried that. The IPs I'm trying to get are those of
computers in a domain, and they aren't registered with a DNS, but are with
WINS.

Thanks anyways,
Jeff

Harris Reynolds said:
Not sure if this is what you are looking for; this will give you the ip
addresses that are bound to the current dns name...
 
Back
Top