Configure dnsmasq for airprint

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
IT_Guy
DD-WRT Novice


Joined: 24 Mar 2024
Posts: 10
Location: USA

PostPosted: Sat Mar 22, 2025 5:47    Post subject: Configure dnsmasq for airprint Reply with quote
I'm trying to get my router to advertise my printer so iOS devices can discover it. I'm running DD-WRT v3.0-r60284 std on a Linksys MX8500. I have Dnsmasq and SmartDNS working. I enabled mDNS and I added the following to my Dnsmasq Additional Options in order to create the necessary DNS records for Airprint:

Code:
# Browse records (point DNS-SD clients to the DNS-SD domain)
ptr-record=r._dns-sd._udp.condo.,condo.
ptr-record=dr._dns-sd._udp.condo.,condo.
ptr-record=b._dns-sd._udp.condo.,condo.
ptr-record=lb._dns-sd._udp.condo.,condo.

# Descriptor for Airprint printer
ptr-record=_ipp._tcp.condo.,clp-320._ipp._tcp.condo.
ptr-record=_universal._sub._ipp._tcp.condo.,clp-320._ipp._tcp.condo.

# Where the print queue can be found
srv-host=clp-320._ipp._tcp.condo.,clp-320.condo.,631

txt-record= {for some reason the board won't post the printer properties}


As you can see, the domain name is 'condo' and the printer name is 'clp-320'. Dnsmasq resolves 'clp-320.condo' and I can access the printer from hosts on my network. However, my iOS devices, connected to the same subnet, still cannot see the printer.

I've poked around the boards here and spent all day with Google but I'm out of ideas. I'd really appreciate any help figuring out where I've gone astray.
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 16206
Location: Texas, USA

PostPosted: Sat Mar 22, 2025 5:56    Post subject: Reply with quote
Not sure if either of these will help you, but happy reading.

https://apple.stackexchange.com/questions/75654/implementing-airprint-with-dns-sd

https://joshdouch.me/wide-area-bonjour-airprint-over-layer-3-vpn/

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
RSS feed for DD-WRT releases (2025)
RSS feed for DD-WRT releases (2024)
RSS feed for DD-WRT releases (2023)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
IT_Guy
DD-WRT Novice


Joined: 24 Mar 2024
Posts: 10
Location: USA

PostPosted: Sat Mar 22, 2025 23:17    Post subject: Reply with quote
Thanks for the quick reply @kernel-panic69. I made a few updates based on those links and a tcpdump of multicast traffic on my system:
Code:
# Browse records (point DNS-SD clients to the DNS-SD domain)
ptr-record=b._dns-sd._udp.condo.,condo.
ptr-record=lb._dns-sd._udp.condo.,condo.

# LPR records
ptr-record=_printer._tcp.condo.,clp-320._printer._tcp.condo.
srv-host=clp-320._printer._tcp.condo.,clp-320.condo.,515,0,0
txt-record=clp-320._printer._tcp.condo.,"txtvers=1","note=Condo","qtotal=1","priority=49","ty=Samsung CLP-320 Series","product=(Samsung CLP-320 Series)","MFG=Samsung","CMD=SPL,PCL5E,PCL6,FWV,EXT,WSP,SCR,CMP,CMS,EWU,AMPV","MDL=CLP-320 Series","Transparent=T","Binary=T","Color=T","Copies=F","Duplex=F","PaperCustom=T","Bind=F","Collate=F","Sort=F","Staple=F","Punch=0"

# LDP records
ptr-record=_pdl-datastream._tcp.condo.,clp-320._pdl-datastream._tcp.condo.
srv-host=clp-320._pdl-datastream._tcp.condo.,clp-320.condo.,9100,0,0
txt-record=clp-320._pdl-datastream._tcp.condo.,"txtvers=1","note=Condo","qtotal=1","ty=Samsung CLP-320 Series","product=(Samsung CLP-320 Series)","MFG=Samsung","CMD=SPL,PCL5E,PCL6,FWV,EXT,WSP,SCR,CMP,CMS,EWU,AMPV","MDL=CLP-320 Series","Transparent=T","Binary=T","Color=T","Copies=F","Duplex=F","PaperCustom=T","Bind=F","Collate=F","Sort=F","Staple=F","Punch=0"

# IPP records
ptr-record=_ipp._tcp.condo.,clp-320._ipp._tcp.condo.
ptr-record=_universal._sub._ipp._tcp.condo.,clp-320._ipp._tcp.condo.
srv-host=clp-320._ipp._tcp.condo.,clp-320.condo.,631,0,0
txt-record=clp-320._ipp._tcp.condo.,"txtvers=1","note=Condo","qtotal=1","priority=51","ty=Samsung CLP-320 Series","product=(Samsung CLP-320 Series)","MFG=Samsung","CMD=SPL,PCL5E,PCL6,FWV,EXT,WSP,SCR,CMP,CMS,EWU,AMPV,URF","MDL=CLP-320 Series","Transparent=T","Binary=T","Color=T","Copies=F","Duplex=F","PaperCustom=T","Bind=F","Collate=F","Sort=F","Staple=F","Punch=0"

# HTTP records
ptr-record=_http._tcp.condo.,clp-320._http._tcp.condo.
srv-host=clp-320._http._tcp.condo.,clp-320.condo.,80,0,0
txt-record=clp-320._http._tcp.condo.,""

However, my iOS devices still don't see the printer. Using DNS-SD I get the following:
Code:
C:\>dns-sd -B
Browsing for _http._tcp
Timestamp     A/R Flags if Domain                    Service Type              Instance Name
16:17:30.558  Add     3  0 condo.                    _http._tcp.               clp-320
16:17:30.558  Add     2 18 local.                    _http._tcp.               Samsung CLP-320 Series (CLP-320)

And, if I use DNS-SD -L to look for clp-320, it returns the correct FQDN of clp-320.condo and its TXT record. Therefore, it appears the dnsmasq entries are working. This leads me to think I have an issue somewhere other than my dnsmasq entries. I'm just not sure how to go about further troubleshooting DNS-SD/avahi.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 16206
Location: Texas, USA

PostPosted: Sat Mar 22, 2025 23:58    Post subject: Reply with quote
Are the wifi interfaces set for mutlicast to unicast? If I am not mistaken, wifi doesn't speak multicast.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
RSS feed for DD-WRT releases (2025)
RSS feed for DD-WRT releases (2024)
RSS feed for DD-WRT releases (2023)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
IT_Guy
DD-WRT Novice


Joined: 24 Mar 2024
Posts: 10
Location: USA

PostPosted: Sun Mar 23, 2025 0:14    Post subject: Reply with quote
I'm definitely not an authority on how Airprint works. However, it is my understanding that an Airprint printer registers with the DNS server and the iOS device queries the DNS server for the DNS-SD search domain, thus unicast rather than multicast. Since my printer is not Airprint-enabled, I have to create those DNS records on its behalf. Now that I have created those, the iOS devices should be able to discover the printer via DNS.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 16206
Location: Texas, USA

PostPosted: Sun Mar 23, 2025 0:39    Post subject: Reply with quote
https://en.wikipedia.org/wiki/Multicast_DNS
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
RSS feed for DD-WRT releases (2025)
RSS feed for DD-WRT releases (2024)
RSS feed for DD-WRT releases (2023)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
IT_Guy
DD-WRT Novice


Joined: 24 Mar 2024
Posts: 10
Location: USA

PostPosted: Sun Mar 23, 2025 2:05    Post subject: Reply with quote
Thanks for the link. My updated understanding:
    1. Airprint client (e.g., iPhone) sends mDNS request for the desired resource (e.g., _ipp._tcp or _printer._tcp) to the multicast address and specifies that a unicast response is desired.
    2. Airprint device (i.e., printer) or DNS-SD server sends unicast response with resource record information for the printer.
    3. Airprint client uses returned resource record to connect to the printer via unicast.

Thus, the WiFi-attached device does not need to receive multicast broadcasts. However, as a side note, WiFi is capable of multicast, per 802.11.https://ieeexplore.ieee.org/document/9363693

Since I manually created the DNS-SD records, when an iOS device requests available printer resources, the DNS resolver should provide those resource records and the iOS device should "see" the printer. It seems like this must be where it is breaking down. Either the iOS device is not sending the request correctly, or dnsmasq is not sending the response. I guess I'll have to see if I can capture that request/response traffic on my router to see what is going on.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 16206
Location: Texas, USA

PostPosted: Sun Mar 23, 2025 2:26    Post subject: Reply with quote
An access point is not a station. I don't think I have to quote the document.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
RSS feed for DD-WRT releases (2025)
RSS feed for DD-WRT releases (2024)
RSS feed for DD-WRT releases (2023)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
IT_Guy
DD-WRT Novice


Joined: 24 Mar 2024
Posts: 10
Location: USA

PostPosted: Sun Mar 23, 2025 3:20    Post subject: Reply with quote
You don't have to do anything. I'm here asking for help and I appreciate anyone willing to try. I'm just working through it.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 16206
Location: Texas, USA

PostPosted: Sun Mar 23, 2025 4:40    Post subject: Reply with quote
Well, we also have to consider that the firmware for the MX8500 is still in development, so there is always a possibility that something is askew there as well.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
RSS feed for DD-WRT releases (2025)
RSS feed for DD-WRT releases (2024)
RSS feed for DD-WRT releases (2023)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
IT_Guy
DD-WRT Novice


Joined: 24 Mar 2024
Posts: 10
Location: USA

PostPosted: Sun Mar 23, 2025 16:17    Post subject: Reply with quote
I hadn’t considered that. I’ll have to dust off my R7000 and see if it behaves any differently.
IT_Guy
DD-WRT Novice


Joined: 24 Mar 2024
Posts: 10
Location: USA

PostPosted: Fri Mar 28, 2025 21:33    Post subject: Reply with quote
I fixed a typo in my dnsmasq config (missed a . in a ptr-record). After reading more documentation I updated my config again.
Code:
# Browse records (point DNS-SD clients to the DNS-SD domain)
ptr-record = b._dns-sd._udp.condo., condo.
ptr-record = lb._dns-sd._udp.condo., condo.

# Services offered
ptr-record = _services._dns-sd._udp.condo., _printer._tcp.condo.         # Line Printer Daemon (LPD) service
ptr-record = _services._dns-sd._udp.condo., _pdl-datastream._tcp.condo.  # Direct socket service
ptr-record = _services._dns-sd._udp.condo., _ipp._tcp.condo.             # Internet Printing Protocol (IPP) service
ptr-record = _services._dns-sd._udp.condo., _http._tcp.condo.            # Ebmedded web server printing service

# LPD records
ptr-record = _printer._tcp.condo., clp-320._printer._tcp.condo.
srv-host = clp-320._printer._tcp.condo.,clp-320.condo.,515,0,0
txt-record = clp-320._printer._tcp.condo., "txtvers=1", "adminurl=http://clp-320.condo/sws/index.html", "air=none", "note=Condo", "priority=49", "product=(Samsung CLP-320 Series)", "qtotal=1", "TLS=", "ty=Samsung CLP-320 Series", "usb_CMD=SPL,PCL5E,PCL6,FWV,EXT,WSP,SCR,CMP,CMS,EWU,AMPV", "usb_MDL=CLP-320 Series", "usb_MFG=Samsung", "Transparent=T", "Binary=T", "Color=T", "Copies=F", "Duplex=F", "PaperCustom=T", "Bind=F", "Collate=F", "Sort=F", "Staple=F", "Punch=0"

# PDL (socket) records
ptr-record = _pdl-datastream._tcp.condo., clp-320._pdl-datastream._tcp.condo.
srv-host = clp-320._pdl-datastream._tcp.condo.,clp-320.condo.,9100,0,0
txt-record = clp-320._pdl-datastream._tcp.condo., "txtvers=1", "adminurl=http://clp-320.condo/sws/index.html", "air=none", "note=Condo", "priority=49", "product=(Samsung CLP-320 Series)", "qtotal=1", "TLS=", "ty=Samsung CLP-320 Series", "usb_CMD=SPL,PCL5E,PCL6,FWV,EXT,WSP,SCR,CMP,CMS,EWU,AMPV", "usb_MDL=CLP-320 Series", "usb_MFG=Samsung", "Transparent=T", "Binary=T", "Color=T", "Copies=F", "Duplex=F", "PaperCustom=T", "Bind=F", "Collate=F", "Sort=F", "Staple=F", "Punch=0"

# IPP records
ptr-record = _ipp._tcp.condo., clp-320._ipp._tcp.condo.
ptr-record = _universal._sub._ipp._tcp.condo., clp-320._ipp._tcp.condo.
ptr-record = _print._sub._ipp._tcp.condo., clp-320._ipp._tcp.condo.
srv-host = clp-320._ipp._tcp.condo., clp-320.condo.,631,0,0
txt-record = clp-320._ipp._tcp.condo., "txtvers=1", "adminurl=http://clp-320.condo/sws/index.html", "air=none", "note=Condo", "priority=49", "product=(Samsung CLP-320 Series)", "qtotal=1", "TLS=", "ty=Samsung CLP-320 Series", "usb_CMD=SPL,PCL5E,PCL6,FWV,EXT,WSP,SCR,CMP,CMS,EWU,AMPV", "usb_MDL=CLP-320 Series", "usb_MFG=Samsung", "Transparent=T", "Binary=T", "Color=T", "Copies=F", "Duplex=F", "PaperCustom=T", "Bind=F", "Collate=F", "Sort=F", "Staple=F", "Punch=0"

# HTTP records
ptr-record = _http._tcp.condo., clp-320._http._tcp.condo.
srv-host = clp-320._http._tcp.condo., clp-320.condo.,80,0,0
txt-record = clp-320._http._tcp.condo., ""

I can now see the printer on iOS devices. However, printing fails; stuck saying it's waiting. I'm wondering if the problem now is that the printer does not support Apple's Universal Raster Format (URF, a.k.a. Apple Raster). I'll have to see if I can get it to work with some other Page Description Language.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 16206
Location: Texas, USA

PostPosted: Fri Mar 28, 2025 21:58    Post subject: Reply with quote
Well, I sure feel less than helpful. I wasn't even paying attention for typos. Embarassed

At least you have progress. I honestly don't know if it would be easier just to get an AirPort Express just to handle Apple AirPrint, but at least this gives others something to look at in the future to help configure.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
RSS feed for DD-WRT releases (2025)
RSS feed for DD-WRT releases (2024)
RSS feed for DD-WRT releases (2023)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
IT_Guy
DD-WRT Novice


Joined: 24 Mar 2024
Posts: 10
Location: USA

PostPosted: Sat Mar 29, 2025 0:26    Post subject: Reply with quote
I've been thinking along the same lines. I'm able to share the printer through CUPS on Linux and print from iOS devices. I'll likely stick with that because it's good enough and I've spent more time on this than the printer is worth.

Thanks!
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum