1

I'm running Arch Linux on two computers. I have been trying to share a USB printer which is connected to a server, so that a client computer can print to it.

Following instructions I found here https://www.cups.org/doc/sharing.html, I ran the following commands on my server to share my printer:

cupsctl --share-printers
lpadmin -p printer -o printer-is-shared=true

This made it possible see the printer on the client machine via the CUPS web interface, "List Available Printers". However, when I added the printer, selected a PPD, and tried to print a test page, I got an error

"Unable to locate printer "server_name.local"."

According to this post which mentions mDNS, I thought maybe this is because I have disabled systemd-resolved which breaks nscd and causes other problems for me. However, when I started it on the client and server I still got the same error.

When I edited /etc/cups/printers.conf to change "DeviceURI" for the printer from

dnssd://name%20of%20local%20printer._ipp._tcp.local/cups?uuid=f7c17874-8003-30ee-40b0-7f21f5f107c3

to

lpd://server_name/name_of_printer_queue

and tried to print a test page, I saw that a connection was established, but eventually got an error "The printer is in use.".

I tried creating a new printer via "Add Printer > LPD/LPR Host or Printer" and tried various device URIs following the URIs under "Examples", like:

ipp://server_name:631/ipp/name_of_printer_queue

This resulted in errors like "The printer configuration is incorrect or the printer no longer exists." or "Filter failed".

I think this technology worked at some point in the past. How can I print to another CUPS server reliably in Linux?

1

After the attempts I just described, I noticed the very bottom of the URL https://www.cups.org/doc/sharing.html says:

The most tedious method of configuring client machines is to configure each remote queue by hand using the lpadmin(8) command: lpadmin -p printer -E -v ipp://server/printers/printer -m everywhere

I tried running this command to modify the printer I had created earlier via the "Find New Printers" button. It was not tedious at all, and I was able to print a test page on the printer which came out immediately.

1

The question is why is CUPS not able to resolve .local names but can find printer with it.

CUPS finds local network printer with the help of avahi/snmp. That only provides the URLs for the printers.

But CUPS never resolve the hostname itself. Inside it uses I guess glibc (?) to open a socket to the host.

Then it sends the URL to your DNS. But the DNS don't knows ".local". He is not able or not configured to know that special ".local" domain. So in your case, the DNS cannot resolve, return an error and breaks it.

With the help of the gnu name service switch (nss) you can provide extensions like nss-mdns (for every ".local") or libnss-winbind (for those only with the "hostname" ).

My problems with cups and resolve .local names vanished after I installed the nss-mdns package + entries for the switch.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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