Skip to main content

A pure python implementation of multicast DNS service discovery

Project description



This is fork of pyzeroconf, Multicast DNS Service Discovery for Python, originally by Paul Scott-Murphy (, modified by William McBrine (

The original William McBrine’s fork note:

This fork is used in all of my TiVo-related projects: HME for Python
(and therefore HME/VLC), Network Remote, Remote Proxy, and pyTivo.
Before this, I was tracking the changes for in three
separate repos. I figured I should have an authoritative source.

Although I make changes based on my experience with TiVos, I expect that
they're generally applicable. This version also includes patches found
on the now-defunct (?) Launchpad repo of pyzeroconf, and elsewhere
around the net -- not always well-documented, sorry.

Compatible with:

  • Bonjour

  • Avahi

Compared to some other Zeroconf/Bonjour/Avahi Python packages, python-zeroconf:

  • isn’t tied to Bonjour or Avahi

  • doesn’t use D-Bus

  • doesn’t force you to use particular event loop or Twisted (asyncio is used under the hood but not required)

  • is pip-installable

  • has PyPI distribution

  • has an optional cython extension for performance (pure python is supported as well)

Python compatibility

  • CPython 3.7+

  • PyPy3.7 7.3+


This project uses semantic versioning.


This project is actively maintained.

Traffic Reduction

Before version 0.32, most traffic reduction techniques described in where not implemented which could lead to excessive network traffic. It is highly recommended that version 0.32 or later is used if this is a concern.

IPv6 support

IPv6 support is relatively new and currently limited, specifically:

  • InterfaceChoice.All is an alias for InterfaceChoice.Default on non-POSIX systems.

  • Dual-stack IPv6 sockets are used, which may not be supported everywhere (some BSD variants do not have them).

  • Listening on localhost (::1) does not work. Help with understanding why is appreciated.

How to get python-zeroconf?

The easiest way to install python-zeroconf is using pip:

pip install zeroconf

How do I use it?

Here’s an example of browsing for a service:

from zeroconf import ServiceBrowser, ServiceListener, Zeroconf

class MyListener(ServiceListener):

    def update_service(self, zc: Zeroconf, type_: str, name: str) -> None:
        print(f"Service {name} updated")

    def remove_service(self, zc: Zeroconf, type_: str, name: str) -> None:
        print(f"Service {name} removed")

    def add_service(self, zc: Zeroconf, type_: str, name: str) -> None:
        info = zc.get_service_info(type_, name)
        print(f"Service {name} added, service info: {info}")

zeroconf = Zeroconf()
listener = MyListener()
browser = ServiceBrowser(zeroconf, "_http._tcp.local.", listener)
    input("Press enter to exit...\n\n")

If you don’t know the name of the service you need to browse for, try:

from zeroconf import ZeroconfServiceTypes

See examples directory for more.




LGPL, see COPYING file for details.

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zeroconf-0.47.4.tar.gz (60.1 kB view hashes)

Uploaded source

Built Distributions

zeroconf-0.47.4-cp311-cp311-win_amd64.whl (775.4 kB view hashes)

Uploaded cp311

zeroconf-0.47.4-cp311-cp311-win32.whl (775.4 kB view hashes)

Uploaded cp311

zeroconf-0.47.4-cp310-cp310-win_amd64.whl (775.4 kB view hashes)

Uploaded cp310

zeroconf-0.47.4-cp310-cp310-win32.whl (778.1 kB view hashes)

Uploaded cp310

zeroconf-0.47.4-cp39-cp39-win_amd64.whl (778.1 kB view hashes)

Uploaded cp39

zeroconf-0.47.4-cp39-cp39-win32.whl (778.1 kB view hashes)

Uploaded cp39

zeroconf-0.47.4-cp38-cp38-win_amd64.whl (778.1 kB view hashes)

Uploaded cp38

zeroconf-0.47.4-cp38-cp38-win32.whl (778.1 kB view hashes)

Uploaded cp38

zeroconf-0.47.4-cp37-cp37m-win_amd64.whl (778.1 kB view hashes)

Uploaded cp37

zeroconf-0.47.4-cp37-cp37m-win32.whl (742.3 kB view hashes)

Uploaded cp37

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page