CUPS unable to automatically locate the network printer

When trying to print, cups gives the following error:

Unable to locate printer ‘BRWXXXXXX.local’

I have avahi running, to get a list of all the network printers, I use lpinfo -v

network http
network beh
network ipp
network socket
network lpd
network https
network ipps
network smb
network dnssd://Brother%20HL-L6200DW%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-XXXX-XXXXXXXXXXXX

The problem could be the correct libraries were not installed.

I installed the libraries as follows: nix-env -iA nixos.nssmdns

To correct the problem I need to add the following using sudo nano /etc/nsswitch.conf

So that the hosts line contains:

hosts: files mdns_minimal dns mdns

However the nsswitch.conf is read only. Any suggestions to help me make this possible correction? I am hoping this gets my network printer to function.

-Les-

Firstly, nix-env works with executables, but not with libraries. It works with executables because they are “installed” in /nix/store/xyy/bin, and the bin directories are added to the PATH environment variable. (In this context) no similar thing happens with libraries, so there’s no way for an executable (or library) to “see” libraries installed with nix-env. That’s the short explanation.

To use mDNS NSS, enable the NixOS option services.avahi.nssmdns

The enabling the nssmdns option will take care of adding the mdns to nsswitch.conf; It will actually use the
option system.nssDatabases.hosts to add the hosts.

Unresolved Wireless Printer

Thanks for the clarification. I have been unable to get my wireless printer (Brother HL-L6200DW) working. I have been trying for several days and decided to plug in a usb cable to use the wireless printer. However, when I am going to a office I volunteer at I cannot take my Lenovo laptop with Nixos. I will have to use another laptop I have with Archlinux which I know functions with the office printer. I will keep on working on the problem.

When I initially set up a wireless HP printer, I got connected by skipping Avahi and connecting via its IP address.

SOLVED

Thanks for the suggestion! You made my day. I disabled Avahi and used the IP address and I can now print.

-Les-

1 Like
Hosted by Flying Circus.