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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cisco switch: ip address to hostname lookup? 1

Status
Not open for further replies.

mtsal

IS-IT--Management
Nov 19, 2003
8
US
Hey,
Is there a way to lookup the hostname or netbios name of a switch on a network via it ip address? If so, can someone provide the command to do this? Thank you.

mtsal
 
The host name is in the config under "hostname routername".

If you do a "show ip interface vlan 1", this will show you all the IP information for that VLAN.
 
Baddos,
Thanks for the reply. Will that work when requiring the name of another switch's hostname and not the current one being worked on? For instance, I'm terminaled in on switch A (there are switches A-J) and I have the ip address of switch E but do not know its hostname. Thank you.
 
Is there any reason why you need the hostname? Cisco doesn't use hostnames for anything other than identification.
 
Good question. We are troubleshooting from a nearby location but don't want to have to walk a half mile to a different idf to look at the hostname. It would save us some time if we could simply look it up from a current location. Thanks.
 
You could setup SNMP or look at "show cdp neighbors".
 
mtsal,

Maybe I am just thnking in the wrong direction on what you exactly want, but lets give it a try:

You can not get the hostname of another switch if you are on a switch using telnet or through console. You could however hop through and telnet the other switch and check the hostname. (This only works if your security settings allow it)

It is also not really clear to me if those switches are stacked, directly connected or are far apart. If the switches are stacked and/or directly connected you can check the neighboring switches hostnames using cdp (show cdp neigh) providing cdp is enabled on the interfaces to wich they are connected.

if I am totaly off track here please tell us exactly what the goal is of knowing the hostname..

InDenial

 
Thanks. We're lazy and just don't want to walk .5 miles to the next building to look up the hostname which we did yesterday but thought we might prevent from doing that. CDP? Correct but, it only works on neighboring switches. Thanks again for all your help.

mtsal
 
Yes... CDP will only work on directly connected switches.

You might want to look into some network discovery tools. I've seen handfuls of them in the past, that find and layout switches, routers, printers, etc. I can't think of their names off the top of my head though. :)

The best way would be to do a full network audit that documents every network switch, router, firewall, etc with their IP addresses, locations, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top