AirPrint or AirPlay Across Subnets
Closed     Case # 10061     Affiliated Job:  New Trier Township District 2031
Opened:  Monday, March 12, 2012     Closed:  Monday, March 12, 2012
Total Hit Count:  8444     Last Hit:  Monday, October 16, 2017 11:40:39 PM
Unique Hit Count:  3043     Last Unique Hit:  Monday, October 16, 2017 11:40:39 PM
Case Type(s):  Network, Server
Case Notes(s):  All cases are posted for review purposes only. Any implementations should be performed at your own risk.

Project:
Our district is exploring how we can offer the AirPrint or AirPlay services to both students and staff. A major problem with Bonjour services is they rely on multicast broadcasted DNS (.local) which resides only on the local subnet a device is connected to. Our wireless is separated into two networks - one offered for students and one for staff.

Action(s) Performed:
Total Action(s): 1
Action # Recorded Date Type Hit(s) User Expand Details
10206 3/12/2012 2:07:36 PM Server 1836 contact@danieljchu.com Some sample illustrations of the configuration and dns-sd query tool are sh  More ...

Outcome:
AirPrint, appears to allow for two options:
-   Option #1: Specifying a "search domain" and in this DNS zone offer the server records required for AirPrint
  o   The first set of records required are entered once, they direct Bonjour services to the location of where to browse the search domain
    --Start Code--
    DNSCMD SERVERNAME /RecordAdd yourdomain.com b._dns-sd._udp PTR yourdomain.com.
    DNSCMD SERVERNAME /RecordAdd yourdomain.com db._dns-sd._udp PTR yourdomain.com.
    DNSCMD SERVERNAME /RecordAdd yourdomain.com dr._dns-sd._udp PTR yourdomain.com.
    DNSCMD SERVERNAME /RecordAdd yourdomain.com lb._dns-sd._udp PTR yourdomain.com.
    DNSCMD SERVERNAME /RecordAdd yourdomain.com r._dns-sd._udp PTR yourdomain.com.
    ^--End Code--^
  o   The second set of records are entered for each printer, i.e. a HP Laserjet CP1525nw
    --Start Code--
    DNSCMD SERVERNAME /RecordAdd yourdomain.com PrinterName A 192.168.0.5
    DNSCMD SERVERNAME /RecordAdd yourdomain.com _ipp._tcp PTR PrinterName._ipp._tcp.yourdomain.com.
    DNSCMD SERVERNAME /RecordAdd yourdomain.com _universal._sub._ipp._tcp PTR PrinterName._ipp._tcp.yourdomain.com.
    DNSCMD SERVERNAME /RecordAdd yourdomain.com PrinterName._ipp._tcp SRV 0 0 631 PrinterName.yourdomain.com
    DNSCMD SERVERNAME /RecordAdd yourdomain.com PrinterName._ipp._tcp TXT "txtvers=1" "qtotal=1" "pdl=application/postscript,application/vnd.hp-PCL,application/vnd.hp-PCLXL,application/pdf,image/urf" "rp=ipp/printer" "URF=CP99,W8,OB10,PQ3-4-5,ADOBERGB24,DEVRGB24,DEVW8,SRGB24,IS1-2-4,MT1-2-3-5-12,MT1-2-3-5-12,RS600" "ty=HP LaserJet CP1525nw" "product=(HP LaserJet CP1525nw)" "priority=10" "adminurl=http://PrinterName.local." "note=Rm 100 (HP LaserJet CP1525nw)" "Color=T" "Duplex=F" "Scan=F"
    ^--End Code--^
-   Option #2: Using a dedicated machine to artificially create these mDNS records (a sort of proxy) on the subnet it is attached to. I have a simple Windows 7 machine multi-homed on both the Staff and Student wireless networks and it is broadcasting the services accordingly.
  o   Install the Bonjour services onto the machine
  o   I added the commands to the Local Group Policy of the machine, setting the commands to run under:
       Local Computer Policy\Computer Configuration\Windows Settings\Scripts\Startup
    --Start Code--
    dns-sd -P "PrinterName" "_ipp._tcp,_universal" "" "631" "PrinterName.local" "192.168.0.5" "txtvers=1" "qtotal=1" "pdl=application/postscript,application/vnd.hp-PCL,application/vnd.hp-PCLXL,application/pdf,image/urf" "rp=ipp/printer" "URF=CP99,W8,OB10,PQ3-4-5,ADOBERGB24,DEVRGB24,DEVW8,SRGB24,IS1-2-4,MT1-2-3-5-12,MT1-2-3-5-12,RS600" "ty=HP LaserJet CP1525nw" "product=(HP LaserJet CP1525nw)" "priority=10" "adminurl=http://PrinterName.local." "note=Rm 100 (HP LaserJet CP1525nw)" "Color=T" "Duplex=F" "Scan=F"
    ^--End Code--^


AirPlay, I tried to replicate the search domain (Option #1 above) with AirPlay; however, I could not get DNS to work. So the Option #2 above is what we went with:
-   Same as above, using the same dedicated machine to artificially create the mDNS records.
  o   This requires two entries per AppleTV, I believe 1st is for video and the 2nd is for audio, but I am not certain.
  o   Again, I added the commands to the Local Group Policy of the machine, setting the commands to run under:
       Local Computer Policy\Computer Configuration\Windows Settings\Scripts\Startup
  o   AirPlay:
    --Start Code--
    dns-sd -P "Apple-TV" "_AirPlay._tcp" "" "7000" "Apple-TV.local" "192.168.0.10" "deviceid=28:E7:CF:00:00:00" "features=0x5a7ffff7" "flags=0x4" "model=AppleTV3,2" "pin=1" "pk=6464646464646464646464646464646464646464646464646464646464646464" "srcvers=160.10" "vv=1"
    ^--End Code--^
  o   AirTunes:
    --Start Code--
    dns-sd -P "28E7CF000000@Apple-TV" "_raop._tcp" "" "5000" "Apple-TV.local" "192.168.0.10" "txtvers=1" "ch=2" "cn=0,1,2,3" "da=true" "et=0,3,5" "ft=0x5A7FFFF7" "md=0,1,2" "pw=false" "pk=6464646464646464646464646464646464646464646464646464646464646464" "sv=false" "sr=44100" "ss=16" "tp=UDP" "vn=65537" "vs=160.10" "vv=1" "am=AppleTV3,2" "sf=0x4"
    ^--End Code--^


We are presently reviewing our options to incorporate AirPrint with our PaperCut deployment which doesn't so far play nicely with either Option #1 or #2.

UPDATE 9/2013: I have revised the AppleTV commands with more current variables. Because of such variables like "pk", I would first search your AppleTV VLAN using dns-sd -Z _AirPlay._tcp and dns-sd -Z _raop._tcp to get all the proper values to pass along to the VLAN you want the artificial record to exist.

We have started this year to make use of these artificial advertisements, we have a special VLAN specifically for the AppleTVs for each of our two campuses. I search out any new AppleTVs, using the two commands above, pull out the various unique attributes and create my 2 dns-sd commands. Since we have a VLAN specific to students vrs staff for each campus we can limit what group sees which AppleTVs.

Instead of the Windows machine, we have a couple Mac Minis which we simply place onto each VLAN - 1 per VLAN, and create a batch with all the advertisements I wish to broadcast and viola - AppleTV adverts specific to each VLAN. We have also enabled pins as to prevent miscellaneous connections from people not in the room.

As for our printers, we have been using a software product called PaperCut, which has introduced a App/AirPrint capabilities to our network printers. So we have not pursued manual artificial advertisements since this does all of this for us.



Profile IMG: Footer Left Profile IMG: Footer Right