Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If I have the IP address of a network printer, how can I get its name using the command line? With the GUI tool system-config-printer the printer's name and IP address shows up in the list.

share|improve this question
    
Have you tried lpinfo -v -h ${ip_addres}:631? –  Cristian Ciupitu Oct 19 '13 at 20:25
    
@CristianCiupitu Thanks for the input but this gives me the same output as lpinfo -v; the socket URI with the IP address is displayed but not the name of the printer. –  August Karlstrom Oct 19 '13 at 20:41
    
ping -a should work, among other things. –  Debra Oct 20 '13 at 0:33
    
@Debra ping -a gives me the same output as without the -a, i.e. no hostname. –  August Karlstrom Oct 20 '13 at 14:59
    
Good to know, though odd -- "ping -a xxx.xxx.xxx.xxx" is supposed to resolve the address to the hostname, and I often use it that way. Perhaps because it's http? –  Debra Oct 21 '13 at 2:32

1 Answer 1

nmap surely accomplishes the tas, see the line http-title

$ nmap -A -T5 192.168.73.10

Starting Nmap 6.00 ( http://nmap.org ) at 2013-10-19 23:58 CEST
Nmap scan report for 192.168.73.10
Host is up (0.068s latency).
Not shown: 875 closed ports, 122 filtered ports
PORT     STATE SERVICE    VERSION
7/tcp    open  echo
80/tcp   open  http       HP Color LaserJet 2600n http config 4.0.2.38
|_http-title: HP Color LaserJet 2600n
9100/tcp open  jetdirect?
Service Info: Device: printer

Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 161.86 seconds
share|improve this answer
    
When I run the nmap command it never seems to complete. The only output I get is Starting Nmap 6.40 ( http://nmap.org ) at 2013-10-20 16:52 CEST –  August Karlstrom Oct 20 '13 at 14:56
    
You have a connectivity problem in your LAN, not a problem with your printer. –  MariusMatutiae Oct 20 '13 at 15:01
    
How come the GUI tool system-config-printer can get the name of the printer then? –  August Karlstrom Oct 21 '13 at 11:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.