Post #1935325
2026-04-07 00:54 UTC
Learned probably too much about mDNS reflecting, AirPrint, IPP, etc.
Turns out AirPrint is pretty much an IPP service being advertised over mDNS*. I was wondering how to put my AirPrint-native printer on a VLAN that forbids internet access and other traffic and have AirPrint still work, using avahi-daemon on a Linux machine.
I had two options, as far as I understand it:
1.) Reflect all mDNS (or filtered) from the printer VLAN to the VLANs wanting to use the printer.
2.) avahi-daemon supports static services, which is to build a service and advertise it.
The second option sounded intriguing. It meant I didn't actually have to reflect mDNS.
The first step was to clone what the printer advertises. On a Linux box that's on the same VLAN as the printer, do:
$ ๐๐๐๐๐-๐๐๐๐ ๐๐ -๐๐ _๐๐๐._๐๐๐
It will produce some output. The important part are the `txt =[ ... ]`. These are the txt-records you need to emulate, especially the `URF=...` part*.
Then on the Linux box where you will be running avahi-service, in `/etc/avahi/hosts`, point the FQDN of the printer to the IP, same as hosts format. Then in `/etc/avahi/services`, make a printer.service file like this gist: https://gist.github.com/johansson/0fdff1bd046f2421725bf1c81e7adaad
You may note that I commented out the fax parts. If you have a multifunctional printer and you never use the fax, this is a godsend. When you add the printer over AirPrint with no fax options, macOS will not annoy you asking if you want to set up the fax portion. And I added a note=Office txt-record, this is the Location entry in macOS, as you can see in the screenshot attached.
And the fun part? Technically, the printer doesn't even have to be AirPrint-native. Just have network+IPP. You can make it AirPrint-capable by doing this. No IPP, only USB? No problem, run an IPP server!
* AirPrint uses the Apple Raster, aka URF, format for printing. https://openprinting.github.io/driverless/01-standards-and-their-pdls/#apple-raster (h/t @clint64)
Replies (0)
No replies.