Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Ping to get NetBios name

Posted on 2007-07-20
5
Medium Priority
?
1,883 Views
Last Modified: 2012-05-05
If I ping an NetBios name I get the IP, is it possible to do this in reverse? So I ping an IP and it gives me the name of the pc.

For example if I use the command 'ping laura' I get the IP 192.168.1.5 however if I want to find the PC name at 192.168.1.5 how do I do this?

Tony
0
Comment
Question by:tonelm54
  • 3
5 Comments
 
LVL 26

Expert Comment

by:Pber
ID: 19531946
ping -a 192.168.1.5
0
 
LVL 26

Accepted Solution

by:
Pber earned 2000 total points
ID: 19531969
doing a:

nbtstat -a 192.168.1.5 will produce more accurate info

Also:
nslookup 192.168.1.5 will return the name if in DNS.
0
 
LVL 88

Expert Comment

by:rindi
ID: 19531992
You'll either need a wins server or edit your hosts file for that. The hosts file is in c:\windows\system32\drivers\etc and is a hidden file. Just add all the PC's you want to get resolved with their IP address.

192.168.1.5      laura
192.168.1.6      Tony
0
 

Author Comment

by:tonelm54
ID: 19532003
Didnt work!

C:\>ping laura

Pinging laura [192.168.1.5] with 32 bytes of data:

Reply from 192.168.1.5: bytes=32 time=174ms TTL=123
Reply from 192.168.1.5: bytes=32 time=54ms TTL=123
Reply from 192.168.1.5: bytes=32 time=55ms TTL=123
Reply from 192.168.1.5: bytes=32 time=56ms TTL=123

Ping statistics for 192.168.1.5:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 54ms, Maximum = 174ms, Average = 84ms

C:\>ping -a 192.168.1.5

Pinging 192.168.1.5 with 32 bytes of data:

Reply from 192.168.1.5: bytes=32 time=54ms TTL=123
Reply from 192.168.1.5: bytes=32 time=55ms TTL=123
Reply from 192.168.1.5: bytes=32 time=51ms TTL=123
Reply from 192.168.1.5: bytes=32 time=53ms TTL=123

Ping statistics for 192.168.1.5:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 51ms, Maximum = 55ms, Average = 53ms

C:\>
0
 
LVL 26

Expert Comment

by:Pber
ID: 19532041
As per what rindi said, you will require a WINS or DNS (or host/LMhost file) for ping -a to resolve the address to the name.

have you tried the nbtstat -a
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question