Fix CUPS not finding a network printer ("Unable to locate printer")
Accurate and current. CUPS really does rely on Avahi for DNS-SD (it cannot use systemd-resolved's mDNS), the packages cups, cups-pdf, avahi, nss-mdns all exist, and the hosts: line matches nss-mdns's documented ordering (mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns). The driverless lpadmin -m everywhere fallback, the VPN/firewall note and the avahi-browse -rt _ipp._tcp / getent hosts verification are all right. Two notes rather than defects. First, on Omarchy 4 cups.service, cups-browsed.service and avahi-daemon.service are already enabled and a shipped /etc/systemd/resolved.conf.d/10-disable-multicast.conf already cedes mDNS to Avahi, so most of this is a no-op there. Second, lpadmin needs administrative rights, so run it as root (fine if you are pasting into a root shell, otherwise prefix sudo).
Symptom
The printer is visible on the network from my phone, but CUPS at http://localhost:631 either does not list it or jobs fail with "Unable to locate printer". /var/log/cups/error_log shows lines like:
Cannot connect to remote printer ipp://HP079676.local
copy_model: empty PPD file
Cause
Modern printer discovery uses DNS-SD/mDNS over .local names. CUPS only supports Avahi for this: it cannot use systemd-resolved's mDNS for service discovery. Without avahi-daemon running and nss-mdns wired into /etc/nsswitch.conf, the .local hostname never resolves.
Fix
sudo pacman -S cups cups-pdf avahi nss-mdns
sudo systemctl enable --now cups.service avahi-daemon.service
Wire mDNS into name resolution. Edit /etc/nsswitch.conf so the hosts: line reads:
hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns
Then restart CUPS so it re-scans:
sudo systemctl restart cups.service
If you would rather not rely on discovery, add the printer by its known address:
lpadmin -p MyPrinter -E -v ipp://192.168.1.50/ipp/print -m everywhere
lpstat -p -d
Also: a firewall or an active VPN will block mDNS/printer traffic. Temporarily disconnect the VPN, or allow mDNS through ufw:
sudo ufw allow 5353/udp
Verify
avahi-browse -rt _ipp._tcp lists the printer, getent hosts HP079676.local resolves, and lpstat -p shows the queue as idle. A test page prints.