Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find IP address from netbios host name?

What network tool can I use under DOS/windows to find the ip address of a netbios host as easily as is done in Linux?

For example under Linux (ubuntu) I can find the ip address like so:

# nmblookup imac
querying imac on 192.168.1.255
192.168.1.75 imac<00>

Now, this is the IP of the macbook when connected wirelessly

But under windows I can't ping it:

C:\>ping imac

Pinging imac.gateway.2wire.net [192.168.1.68] with 32 bytes of data:
Request timed out.

And the closest tool I could find returns TWO IPs (it returns the hardwired IP even though it got a different IP by connecting wirelessly

C:\>nslookup imac
Address:  192.168.1.254
Name:    imac.gateway.2wire.net
Addresses:  192.168.1.68, 192.168.1.75

Isnt there a windows command to return only the active IP address for the host?

like image 477
draca Avatar asked Jan 24 '14 18:01

draca


People also ask

What is a NetBIOS name?

The local NetBIOS name associated with the connection. The name or IP address associated with the remote computer. The last byte of a NetBIOS name converted to hexadecimal. Each NetBIOS name is 16 characters long.

What is the NetBIOS name cache purge?

Purges the contents of the NetBIOS name cache and then reloads the pre-tagged entries from the Lmhosts file. Releases and then refreshes NetBIOS names for the local computer that is registered with WINS servers. Displays NetBIOS client and server sessions, attempting to convert the destination IP address to a name.

What are the possible NetBIOS connection States?

The possible NetBIOS connection states, include: A session has been established. This endpoint is available for an inbound connection. This endpoint has been opened but cannot receive connections. A session is in the connecting phase and the name-to-IP address mapping of the destination is being resolved.

What is the wins command in NetBIOS?

This command also allows a refresh of the NetBIOS name cache and the names registered with Windows Internet Name Service (WINS). Used without parameters, this command displays Help information.


1 Answers

On Windows, you can try

  • ping -a IP_address (lookup for both DNS name and NetBIOS name)
  • nslookup IP_address (this command requires you to have an internal DNS server configured)

I like to use ping -a personally.

like image 74
Hao Nguyen Avatar answered Oct 07 '22 00:10

Hao Nguyen