Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Inject copies of Bonjour(/Zeroconf/Avahi/mDNS) records under a different name.
Python Shell
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Bonjour Aliases

A project born of the burning desire to be backwards compatible --
served with a dash of bitterness.

Motivation: CUPS 1.6 started to advertise printers as "printer @ server"
instead of the old "printer @", thereby making
existing printer entries in MacOS clients unusable.  This script eases
the transition period between the two standards (at least it did for me
and my users for all I know).

I elaborated a bit on the corresponding Debian bug report,

WARNING: At the moment, all server name patterns are hard-coded, so this
very much only serves my needs.  If Bonjour aliases sound like a good
idea to you, I suggest you simply email me and I'll be happy to make
this a all-purpose, all-weather software product.

WARNING 2: This script places a heavy burden on DBUS.  I have seen it
crashing a couple of times on a machine that serves multiple interfaces
(each Bonjour record needs to be duplicated for every interface).
Caveat emptor!

While I'm at it...

Disclaimer and Licence

As Pilates once put it: if you choose to use this software, you're
completely on your own.  You're responsible for any damage that you
incure by using this code in whatever way.  "No fitness for a particular
purpose..." you know the drill.

Licence: Newest GPL.  See <>
This licence covers all code in this repository.

Quick Start

On Debian, install the requisites and verify that it's doing what it's
supposed to::

    apt-get install libavahi-compat-libdnssd1 python-pip
    pip install pybonjour

See, if, on a different machine in the same physical net, you can see
the aliases::

    avahi-browse -a | grep [pattern]

If happy, install daemontools or runit and symlink this directory under

    apt-get install daemontools-run
    update-service --add /root/bonjour_aliases/ bonjour_aliases

Check status, shutdown and start service::

    svstat /etc/service/bonjour_aliases
    svc -d /etc/service/bonjour_aliases
    svc -u /etc/service/bonjour_aliases

After a few days start sending friendly bug reports (to me) and possibly
remind your users to switch their printer entries to the new convention.

Long, Winding Story

This project currently solves one and only one scenario: It creates
name-aliases to Bonjour records from already published records.  Say you
are running a printserver and it publishes your printers like this:

    printer1 @ my.domain

You discover that, after an innocuous update, the very same printserver,
for whatever reasons, starts publishing the very same printers with
records named like this[0]:

    printer1 @ my

Being the good sysadmin that I am, I wanted my users to not suffer the
inconvenience of discovering that they'd have to remove all Bonjour
printers only to add them again (thereby possibly losing their precious

The project conveniently includes a 'run' file that's suitable for
supervisors such as daemontools or runit.

[Note: Currently, names are hardcoded in the source code -- please do
contact me if you want a more generic version!]

2013-09-05, by Hagen Fuchs

[0] The printserver in question is the excellent CUPS, updating
    from version 1.5 to 1.6.

Something went wrong with that request. Please try again.