Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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" 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

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

$ nmap -A -T5

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

Service detection performed. Please report any incorrect results at .
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 ( ) 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .