79 votedIf you found this information useful, click here to vote! No registration required.

Section A : Enable your DNS Search Domain to be DNS-SD ready

First you need to setup the DNS server be “DNS Service Discovery” enabled – to accept DNS Service Records (in a database) and to enable clients to search your domain.  This only needs to be performed once on the DNS server.  This tutorial contains specific information for Microsoft DNS server, however if you want greater enhancement of this service look at BIND9.

Hint: Throughout this tutorial the domain is referred to as mc.net.mackillop, the print server name is xserve.mc.net.mackillop and the printer is called printer1.

  1. Under mc.net.mackillop right-click on _udp and select “Other new records…”
  2. Select to insert a SRV record.
    1. In the Service field, type in any character (this record will be removed later therefore it doesn’t matter what you call it, this process simply creates the appropriate protocol service folder).
    2. In Protocol enter _dns-sd and hit OK.
    3. You should now have mc.net.mackillop > _udp > _dns-sd folders, delete the SRV record from within the _dns-sd folder that was created.
    4. Right-click on the _dns-sd folder and select “Other new records…” and select to insert a PTR record.
      1. In Host IP Address enter the letter ‘b’
      2. In Host Name enter mc.net.mackillop.  (with a period at the end!)
      3. Repeat step 4 with db, dr, lb and r in place of the Host IP Address.
      4. This is how the final structure should appear:
        images8

Ensure your search domain is set in DHCP

One thing to check is to make sure that your DHCP server has this domain entered in the Search Domains option (015 DNS Domain Name) so clients are aware of the domain they need to query, otherwise they will query .local

The initial setup of enabling your DNS domain to be discovered is now complete!

79 votedIf you found this information useful, click here to vote! No registration required.

Section B : Add services to be discovered

There are a huge number of services with individual requirements that can be entered into DNS for discovery.  See Reference 1 at the bottom of this tutorial for a list.  For this example we will add an IPP Printer.  Remember that any services you wish to share over DNS-SD must use a routable protocol!

Known Limitations:

  • Names in Microsoft’s DNS:
    • Cannot contain spaces
    • Characters are converted to lowercase
    • You can use hyphens -.

As this is an IPP printer, we need to add the _ipp folder under the _tcp folder.

  1. Under mc.net.mackillop right-click on _tcp and select “Other new records…”
  2. Select to insert a ‘Service Location (SRV)’ record.
    1. In Service, type in any characters (this record will be removed later, this process simply creates the appropriate service folder).
    2. In Protocol enter _ipp and hit OK.
    3. You should now have mc.net.mackillop > _tcp > _ipp folders, delete the SRV record from within the _ipp folder.
    4. Each printer requires three different entries, PTR, SRV and TXT:
      Right-click on the _ipp folder and select “Other new records…” and select to insert a ‘Pointer (PTR)’ record.

      1. Leave the Host IP Address field blank
      2. In Host Name enter where the printer records are going to appear in DNS, which will be: printer1._ipp._tcp.mc.net.mackillop.  (with a period at the end!)
        images6
      3. Right-click on the _ipp folder and select “Other new records…” and select to insert a SRV record.
        1. In Service enter printer1
        2. In protocol enter _ipp
        3. In port number enter 631 (for a CUPS shared IPP printer)
        4. In Host offering this service enter the FQDN of the print server: xserve.mc.net.mackillop.  (with a period at the end!)
          images4
        5. Right-click on the _ipp folder and select “Other new records…” and select to insert a ‘Text (TXT)’ record.
          1. In Record Name enter in printer1
          2. The TXT record is used to provide additional information regarding a SRV that is being advertised.  Most SRV’s require a TXT record.  Below is an example of a TXT record for a printer (obviously most items will need modification):

txtvers=1
qtotal=1
rp=printers/printer1
ty=HP LaserJet P2055 with Duplexer
note=Science Staffroom
priority=0
product=(Hewlett-Packard HP LaserJet P2055x)
printer-state=3
printer-type=0x809056
pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png

images5

That is all that is needed to advertise your first printer.

Hint:  If you are unsure of exactly what items to enter into the TXT record download an App called “Bonjour Browser” on a Mac on the subnet where the Bonjour service is being advertised.  This enables you to browse the records so you can type them in the same in the DNS.

Screenshot of Bonjour Browser:

images3

79 votedIf you found this information useful, click here to vote! No registration required.

Section C : Add printers to be discovered by iOS devices

Requirements:

  • The printer must be shared using CUPS on a Mac server sharing with IPP
  • In the CUPS server admin (you can access this via http://localhost:631 on the CUPS server):
    • “Allow printing from the Internet” must be ticked and saved/service restarted.  This enables printing from other subnets.
    • In Edit Configuration File add:
      • BrowseAddress @mc.net.mackillop
      • ServerAlias xserve.mc.net.mackillop
        • Example:

LogLevel warn
SystemGroup admin
SystemGroupAuthKey system.print.admin
# Allow remote access
Port 631
Listen /private/var/run/cupsd
# Share local printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseRemoteProtocols
BrowseAddress @LOCAL
BrowseAddress @mc.net.mackillop
BrowseLocalProtocols CUPS dnssd
DefaultAuthType Basic
WebInterface Yes
ServerAlias ios.mc.net.mackillop
<Location />
…etc…

 

Hint: For this example I will add an AirPrint compatible printer that can be printed to across subnets (VLANS).  The domain is mc.net.mackillop, the print server name is ios.mc.net.mackillop and the printer is called printer1.

After setting up your printer to work with Bonjour printing as described in Section 1 and 2 above, the following modifications are required to be made for the printer to be shared with iOS devices.

We need to add a folder under the _ipp folder called _sub. Use similar steps as Section A Steps 1 – 3 to create this folder.  Inside the _sub folder create two more folders using the same method called _universal and _cups.  The end hierarchy should look like this:

images7

  1. Right-click on _universal and select “Other new records…”
  2. Select to insert a PTR record.
    1. Leave Host IP empty
    2. Enter the printers location in DNS in Host Name, printer1._ipp._tcp.mc.net.mackillop
    3. Enter the same PTR record under the _cups folder.
    4. Repeat adding these two PTR records under both _universal and _cups folders for each printer you wish to share via AirPrint
    5. The following modifications are required to the original printers TXT file located under mc.net.mackillop > _tcp > _ipp:
      1. Add “image/urf,image/pwg-raster” to the pdl list Hint: Ensure to include image/pwg-raster as this often aids in iOS 7 support
      2. Add this line at the bottom “URF=W8,SRGB24,CP1,RS600

That is all that is required for your printer to be shared via AirPrint!

 

Common issues:

Q. Changes that I’m making to DNS aren’t appearing on my test computer

A. The quickest way I found for the records to be updated on your test computer is to modify your DNS server to a different one (even if it is invalid), then apply the network settings and change it back to your correct DNS server.  This flushes and requests the new DNS-SD records.

Q. CUPS error log “Request from client IP address using invalid Host: field print.server

A. The CUPS print server is secured to prevent print jobs from unauthorised subnets and servers.  Enter ‘ServerAlias print.server’ in the CUPS config, or ‘ServerAlias *’ to cover all bases.  Remember to take into account security as IPP is Internet Printing Protocol, if port 631 is available to the Internet anyone can print to your CUPS server…

Q. mdnsresponder ptr received from network is not valid DNS-SD service pointer

A. I experienced this issue, and at time of writing I forget how I resolved it.  However I will leave this Q here to remind me to research.

Q. mdns application protocol name must begin with an underscore

A. I experienced this issue, and at time of writing I forget how I resolved it.  However I will leave this Q here to remind me to research.

References:

  1. DNS SRV (RFC 2782) Service Types www.dns-sd.org/ServiceTypes.html
  2. Using Bonjour Across Subnets http://www.grouplogic.com/Knowledge/PDFUpload/Info/WanBonjour_1.pdf
  3. Network-wide AirPrint and easy printer configuration through DNS-SD http://philkomarny.com/?p=63
  4. Bonjour and DNS Service Discovery http://dyn.com/support/bonjour-and-dns-discovery/
  5. Manually Adding DNS-SD Service Discovery Records to an Existing Name Server http://dns-sd.org/ServerStaticSetup.html
  6. iOS printing via CUPS http://hints.macworld.com/article.php?story=20101027080807322
  7. About AirPrint and Bonjour http://thomas.dereyck.eu/wiki/Setting%20up%20inter-subnet%20AirPrint%20on%0any%0printer%20with%20CUPS%20and%20a%20regular%20DNS%20server

 

79 votedIf you found this information useful, click here to vote! No registration required.

 

 

Share →

9 Responses to Configuring DNS to share Bonjour printers across subnets and VLANs (including AirPrint for iOS)

  1. helePeers says:

    Have you ever considered about including a little bit more than just your articles? I mean, what you say is important and all. However think about if you added some great pictures or videos to give your posts more, “pop”! Your content is excellent but with pics and clips, this blog could undeniably be one of the greatest in its field. Superb blog!

  2. Richard Hindley says:

    This is working fine with IOS 6 device, but we have just hit a snag with IOS 7 devices which are refusing to list printers discovered over DNS-SD. I can see from Wireshark that the iPad is querying the DNS server as expected and pulling the records – but it doesn’t list the printers. The TXT records are ok, I think, as the printers appear as expected on IOS 7 devices if queried via mDNS. Strange.

    • Sam says:

      Hi Richard,
      I have to admit that I am no longer working in an iOS centric workplace (I use to work in a school where we had an iPad for every student, now I’m working for the Government but luckily for me they are looking at introducing BYOD. When I get an opportunity I will try out iOS7 and see if I can get this working for it.
      Kind regards,
      Sam.

      • Jim says:

        Hi Sam,

        Have exactly the same issue as Richard in that our iOS6 devices are working like a dream in that they find and display the printer records with no problem. However, our recently updated iOS7 devices are simply not returning any of the advertised printers and display ‘No AirPrinters Found’. Wireshark as per Richard’s note however is showing the correct records as per iOS6 being passed to the devices.

        This would lead to me to believe that this is indeed an Apple issue as opposed to a problem with any DNS configuration but Apple seem to be burying their head in the sand on this one as reported issues around post iOS7 update airprint issues are going unanswered. If you however did find a way to get this working under 7 without becoming an Apple employee then ‘Kudos’ would be due.

        • Sam says:

          Hi Richard and Jim,

          Can you test something for me? I just set up a Windows Server 2008 DNS server at home and followed the guide and it didn’t show a printer for me. After adding an additional pdl in the printers TXT record, it works!

          Try adding image/pwg-raster into the pdl list, remember to flush the DNS from the iOS device (add a bogus DNS entry in, apply it by going back to network listing, remove bogus DNS entry) and see if it works for you?

          Thanks,
          Sam.

          • Jim says:

            Hi Sam,

            Hasn’t worked for me unfortunately. Tested on separate 7 devices (iphones). 6 (pad) still working and listing correctly.

            Entire pdl looks like this:

            pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/urf,image/pwg-raster

          • Sam says:

            Hi Jim,
            Thanks for testing. It is working for me so maybe there is something else different in your system. Can you take a screen shot of Bonjour Browser and send it through to me?
            Thanks,
            Sam.

  3. Young says:

    Sam,

    I’m having the same problem with iOS 7.0.2. Actually, I was able to see printers with iOS 7.0.2 except they were not listed as authentication being required (the lock icon next to the printer name) however it always works on iOS 6 and under. Recently I looked after upgrading to iOS 7.0.4, and now I don’t see the printer at all but it still works fine on iOS 6.

    product=(EFI)
    EFI=b53fd1512a8c3b18dbf24fb45568b5014ddaeda2
    txtvers=1
    qtotal=1
    usb_MFG=Apple
    Duplex=T
    note=DNS
    URF=W8,CP1,RS300-600,DM3,SRGB24
    air=username,password
    pdl=image/urf,application/pdf,application/octet-stream,image/jpeg,image/png,image/pwg-raster
    rp=ipp/5
    usb_MDL=Color LaserWriter 12/660 PS
    priority=0

    • Young says:

      Correction, I still see advertised printers on iOS 7 but the required authentication is not working.
      “air=username,passwod” doesn’t have any effects on iOS 7 at all.

Leave a Reply

Your email address will not be published. Required fields are marked *