Announcement

Collapse
No announcement yet.

How to get printer name with IP address

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to get printer name with IP address

    Hello! I'm not really certain if this qualifies as a network question but it's about as close as it comes.

    Okay i have my printer setup via WPS it's working fine but i was wondering if there's any way of getting the printer name from the terminal using just the machines ip address?

    #2
    I find this ridiculously difficult if there's several printers.

    There's two separate namespaces, that of printers, shown by lpstat -e, and those about the local network, as shown by many utilities, such as nmap -sT.
    (If there's only one printer, well, I can conclude the printer found by both sets of utilities must be the same one.) Here's my set up at home, and I have only one printer:
    Code:
    $ lpstat -e
    system default destination: Brother_MFC_J5330DW
    device for Brother_MFC_J5330DW: implicitclass://Brother_MFC_J5330DW/
    $ nmap -sT 192.168.1.201
    Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-04-09 18:20 NZST
    Nmap scan report for Paul.hub (192.168.1.201)
    Host is up (0.0097s latency).
    Not shown: 995 closed tcp ports (conn-refused)
    PORT STATE SERVICE
    80/tcp open http
    443/tcp open https
    515/tcp open printer
    631/tcp open ipp
    9100/tcp open jetdirect
    
    Nmap done: 1 IP address (1 host up) scanned in 0.21 seconds
    sudo arp-scan --localnet comes close, because it deduces the device manufacturer from the MAC address, and with luck this makes printers obvious:
    Code:
    $ sudo arp-scan --localnet
    [sudo] password for john:
    Interface: enp0s31f6, type: EN10MB, MAC: 1c:1b:0d:09:9e:a1, IPv4: 192.168.1.100
    Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
    192.168.1.1 10:13:31:a8:73:a0 Technicolor Delivery Technologies Belgium NV
    192.168.1.4 e8:94:f6:fa:8b:b3 TP-LINK TECHNOLOGIES CO.,LTD.
    192.168.1.136 12:13:31:a8:73:a9 (Unknown: locally administered)
    192.168.1.201 30:05:5c:f8:d6:02 Brother industries, LTD.
    
    4 packets received by filter, 0 packets dropped by kernel
    Ending arp-scan 1.10.0: 256 hosts scanned in 1.958 seconds (130.75 hosts/sec). 4 responded
    However, I found avahi-browse in the avahi-utils package, and put together the magic incantation:
    Code:
    $ avahi-browse -t -r _ipp._tcp
    + enp0s31f6 IPv6 Brother MFC-J5330DW                                                                                                                                Internet Printer local
    + enp0s31f6 IPv4 Brother MFC-J5330DW                                                                                                                                Internet Printer local
    = enp0s31f6 IPv6 Brother MFC-J5330DW                                                                                                                                Internet Printer local
    hostname = [Paul.local]
    address = [192.168.1.201]
    port = [631]
    txt = ["mopria-certified=1.3" "print_wfds=T" "UUID=e3248000-80ce-11db-8000-30055cf8d602" "PaperMax=tabloid-A3" "kind=document,envelope,postcard,photo" "URF=SRGB24,W8,CP1,IS1,MT1-8-11,OB9,PQ4-5,RS200-300,OFU0,V1.4,DM4" "rfo=ipp/faxout" "TBCP=F" "Transparent=T" "Binary=T" "PaperCustom=T" "Scan=T" "Fax=T" "Duplex=T" "Copies=F" "Color=T" "usb_CMD=HBP,PJL" "usb_MDL=MFC-J5330DW" "usb_MFG=Brother" "priority=25" "adminurl=http://Paul.local./net/net/airprint.html" "product=(Brother MFC-J5330DW)" "ty=Brother MFC-J5330DW" "note=" "rp=ipp/print" "pdl=application/octet-stream,image/urf,image/jpeg,image/pwg-raster,application/vnd.brother-hbp" "qtotal=1" "txtvers=1"]
    = enp0s31f6 IPv4 Brother MFC-J5330DW                                                                                                                                Internet Printer local
    hostname = [Paul.local]
    address = [192.168.1.201]
    port = [631]
    txt = ["mopria-certified=1.3" "print_wfds=T" "UUID=e3248000-80ce-11db-8000-30055cf8d602" "PaperMax=tabloid-A3" "kind=document,envelope,postcard,photo" "URF=SRGB24,W8,CP1,IS1,MT1-8-11,OB9,PQ4-5,RS200-300,OFU0,V1.4,DM4" "rfo=ipp/faxout" "TBCP=F" "Transparent=T" "Binary=T" "PaperCustom=T" "Scan=T" "Fax=T" "Duplex=T" "Copies=F" "Color=T" "usb_CMD=HBP,PJL" "usb_MDL=MFC-J5330DW" "usb_MFG=Brother" "priority=25" "adminurl=http://Paul.local./net/net/airprint.html" "product=(Brother MFC-J5330DW)" "ty=Brother MFC-J5330DW" "note=" "rp=ipp/print" "pdl=application/octet-stream,image/urf,image/jpeg,image/pwg-raster,application/vnd.brother-hbp" "qtotal=1" "txtvers=1"]
    I'd like to know a better way.
    Regards, John Little

    Comment


      #3
      jlittle

      i have a meta question, something that's been bugging me about this forum.

      how do get the inline text to show up as code with the change in background and monospace font?

      warping a block of text in a code block works but i've not figured out how to do the inline code format like i'm seeing in your post

      Comment


        #4
        Originally posted by skyfishgoo View Post
        how do get the inline text to show up as code
        Use the "$" button on the toolbar or use the console formatting bbcode

        Code:
        [console] This is inline text[/console]
        This is inline text

        Comment

        Working...
        X