Closed EricFromCanada closed 1 year ago
Revised to have the service discovery records use the name of the printer instead of the router hostname, so added printers won't need to be re-associated if the router hostname changes.
Thanks for your contribution!
This PR corrects the service discovery DNS records that are added to the dnsmasq configuration when a printer is detected.
For static service discovery records being served from a unicast DNS server, the PTR record that associates a service (e.g. _pdl-datastream._tcp) with a hostname needs to have matching SRV and TXT records for that hostname. Currently the SRV is always set to "Gargoyle"; I've changed it and the PTR and TXT records to use the printer name with spaces replaced with underscores.
This also adds some logic that fetches the device manufacturer from the USB device and includes it as the
usb_MFG
attribute, which may help OSes with picking the correct printer driver, along with two more attributes that set thenote
to the router hostname andpdl
to "raw".On macOS with these changes, the printer now shows up in the printer browser with the printer name and the hostname as the Location.
For reference, here's what a series of DNS queries for successful unicast service discovery could look like (assuming a search domain of "home" is set on a 10.10.1.0/24 network):