How To: Create Printer Discovery in DNS for MAC Clients

How to create printer discovery in DNS for MAC clients

Mac OS from version 10.8 on discovers printer by using multicast DNS (mDNS or Bonjour). However, if your printers are located in a different IP-subnets this does not work as mDNS is limited to the local net only.
But mDNS works in conjunction with DNS Service Discovery (DNS-SD). So what you would need is to enable the bind nameserver from UCS to serve the needed service records.

Note: UMC currently does not allow the creation of such records. See this bug. Because of this the below steps are not persistent during updates. The files from Steps 2 will get overwritten every time when UMC rewrites the DNS configuration.
Additional Note: The changes could be made permanent when editing /etc/univention/templates/files/etc/bind/named.conf.samba4 but this will prevent UCS getting newer releases of this template file.


Step 1

Identify the backend you are using for your environment by using the ucr command:

root@master:/etc/bind# ucr get dns/backend

If using Samba you would get “samba4” back instead of the above "ldap".

In the further steps you need to edit the configuration files according to your backend.

Step 2

Add the response-policy to your configuration file.

For ldap use named.conf.proxy.
For samba4 use named.conf.samba4.

In the section

options {

add the following lines:

response-policy { zone "rpz"; };

Step 3

Add the zone entry to the configuration files.

For ldap use /etc/bind/local.conf.proxy
For samba4 use /etc/bind/local.conf.samba4

Add the following lines:

zone "rpz" {
	type master;
	file "/etc/bind/db.rpz";

Step 4

Create the above mentioned zone file /etc/bind/db.rpz with the following content

Please change

  •” by your domain
  •” by the full hostname of your printserver - dont forget the dot at the end.
  • “printer01” and “printer02” by the printernames of the printers, you want to publish
  • the TXT-values with your printers values. For informations about that, please consult your printers manufactor and Apples bonjour-documentation.
$TTL 60
@	IN	SOA	localhost. root.localhost. (
				1	; serial - needs to be increased on each change.
				1h	; refresh
				15m	; retry
				30d	; expiry
				2h	; minimum
 			IN	NS localhost.

; define global dns-sd overwrites			    IN PTR			    IN PTR

; define _ipp-records per printer			        IN PTR			        IN PTR

; define _cups-records per printer		IN PTR		IN PTR

; define _universal-records per printer	IN PTR	IN PTR

; define srv-records per printer	        IN SRV  0 0 631	        IN SRV  0 0 631

; define TXT-records per printer 		IN TXT ( 
			   "product=(Xerox WorkCentre 7556)"
			   "ty=Xerox WorkCentre 7556"
			  ) 		IN TXT ( 
			   "product=(Xerox WorkCentre 7556)"
			   "ty=Xerox WorkCentre 7556"
  • The b and lb entries tell the clients to use DNS for service discovery.
  • The _ipp and _cups entries point to the printer itself.
  • The _universal is needed for AirPrint.
  • The printer SRV record tells where the printer is attached to.
  • the TXT-record gives details about the used printer model.

You can check your zone-file with the following command:

root@master:~# named-checkzone /etc/bind/db.rpz
zone loaded serial 1

Step 5

Restart your bind DNS server:

systemctl restart bind9

Step 6

Verify the entry is available by requesting the PTR records from your DNS server to see if it works:

host -t PTR

This will show all printer capable of doing IPP over TCP. If this works your basic setup works.

If your are using linux as guest operatingsystem, you can also check the DNS-settings with avahi:

root@master:~# avahi-browse -rt -d _ipp._tcp
+   k.A. k.A. printer02                                     Internet Printer
+   k.A. k.A. printer01                                     Internet Printer
=   k.A. k.A. printer02                                     Internet Printer
   hostname = []
   address = []
   port = [631]
   txt = ["pdl=application/postscript" "ty=Xerox WorkCentre 7556" "note=Room.120" "product=(Xerox WorkCentre 7556)" "adminurl=ipp://" "rp=printers/printer02" "qtotal=1" "txtvers=1"]
=   k.A. k.A. printer01                                     Internet Printer     duch.on
   hostname = []
   address = []
   port = [631]
   txt = ["pdl=application/postscript" "ty=Xerox WorkCentre 7556" "note=Room.121" "product=(Xerox WorkCentre 7556)" "adminurl=ipp://" "rp=printers/printer01" "qtotal=1" "txtvers=1"]