4 Replies - 11965 Views - Last Post: 23 November 2007 - 07:18 PM Rate Topic: -----

#1 itpro4470  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 156
  • Joined: 17-June 07

Getting a remote Hostname

Post icon  Posted 22 November 2007 - 02:56 PM

I am writing an IP scanner which will return the ping time in ms and the hostname. I haven't been able to get the hostname no matter how hard I try. If I use Dns.GetHostEntry(ipAddress).Hostname I just get the ip address and I get the same results when using the depreciated function gethostbyaddress. please help.
Is This A Good Question/Topic? 0
  • +

Replies To: Getting a remote Hostname

#2 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Getting a remote Hostname

Posted 22 November 2007 - 04:25 PM

Works for me:
MessageBox.Show(Dns.GetHostEntry("207.46.193.254").HostName)


Maybe try getting the Hostname by passing in the IP address into the GetHostEntry method of the DNS class in this way.
Dim hostIp As IPHostEntry = Dns.GetHostEntry("207.46.193.254")
MessageBox.Show(hostIp.HostName)


You could also pass in the site address rather than the IP address.
Dim hostIp As IPHostEntry = Dns.GetHostEntry("www.microsoft.com")
MessageBox.Show(hostIp.HostName)

Was This Post Helpful? 0
  • +
  • -

#3 itpro4470  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 156
  • Joined: 17-June 07

Re: Getting a remote Hostname

Posted 23 November 2007 - 08:12 AM

Thats what I had but I wasn't scanning anything outside of my local netwok when I did a short scan on my ISPs IP addresses I got the hostnames. I found out what I'm looking for is to find the netBIOS name of a remote computer I have been searching all over with google, yahoo etc but I have only found out how to do this for the local machine.
Was This Post Helpful? 0
  • +
  • -

#4 itpro4470  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 156
  • Joined: 17-June 07

Re: Getting a remote Hostname

Posted 23 November 2007 - 07:13 PM

avatar test
Was This Post Helpful? 0
  • +
  • -

#5 snoj  Icon User is offline

  • Married Life
  • member icon

Reputation: 84
  • View blog
  • Posts: 3,564
  • Joined: 31-March 03

Re: Getting a remote Hostname

Posted 23 November 2007 - 07:18 PM

That's because netbios names are only for local networks.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1