Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

mDNS Options

Ben edited this pageJan 6, 2025 ·9 revisions

Homebridge uses mDNS-based service discovery in order for your accessory to be discovered by your Apple devices (seeA beginner’s guide to mDNS and DNS-SD for a more detailed explanation).

Homebridge provides a range of mDNS Advertisers it can interface with to advertise itself on the local network.

Bonjour-HAP

Bonjour-HAP is the default and legacy advertiser. It is not as efficient in terms of system resource usage and network traffic when compared to the other options.

Ciao

Ciao is aRFC 6763 compliantdns-sd and advertising on multicast dns (RFC 6762) library developed by Homebridge.It is entirely written in TypeScript, and therefore tries to be platform-independent.

For non-Linux users,ciao should provide the best experience. It fixes a lot of the deficiencies of thebonjour-hap advertiser. However, you might experience issues in the following two scenarios.

Network Interface Selection

Whilebonjour-hap only advertises on the primary network interface,ciao tries to be aware of multiple network interfaces. On startup, it tries to evaluate which network interfaces to advertise on by default.
In certain circumstances,ciao is unable to properly determine the set of valid network interfaces (e.g., when dealing with virtual network interfaces on containerised environments).In those cases, it might be helpful to manually define the set of network interfaces (seebelow). Otherwise, fall back to thebonjour-hap advertiser.

Multiple Advertisers

On some systems, there is already a mDNS advertiser stack running (e.g. avahi on linux).There might be issues running multiple mDNS advertisers on the same host (seeNotice on native mDNS responders).

Avahi (Linux and Docker)

Avahi is a mDNS advertiser that is installed by default on many linux distributions.As of Homebridge 1.4.0, Homebridge can be configured to advertise itself by interfacing with avahi via its dBus interface.

For Linux users,Avahi should provide the best experience.Note that your system must have theavahi-daemon anddbus services installed and running for this option to work.

For using the host'savahi-daemon from Docker, mount/var/run/dbus:/var/run/dbus and/var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket as volumes so the container has a path to communicate with theavahi-daemon. Unless you've disabled AppArmor on your Linux distro, or it's disabled by default, you'll also need to set asecurity_opt setting ofapparmor:unconfined, otherwise AppArmor will block the container's attempt to talk to Avahi viadbus. Here's a sample snippet of what this all looks like in adocker-compose.yml:

    security_opt:      - apparmor:unconfined    volumes:      - /var/run/dbus:/var/run/dbus      - /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket      - ...

systemd-resolved (Linux only, experimental)

As of Homebridge 1.6.0, Linux users can choose theresolved advertiser, which uses systemd-resolved via D-Bus. If your system already uses systemd-resolved for mDNS support, this will likely provide the best experience. You can check this by runningresolvectl mdns; if the first line isGlobal: yes, you should use this advertiser.

Using theresolved advertiser has the following prerequisites:

  • Havingsystemd-resolved anddbus services installed and running.
  • HavingMulticastDNS configured and enabled (seehttps://linuxreviews.org/Systemd-resolved).
  • Having configured the respective permissions to allow Homebridge to accesssystemd-resolved (see below).

Setting up theresolved advertiser is only advised for more experienced users.

Configuring permissions for systemd-resolved

The user that runs Homebridge must have permission to register and unregister DNS-SD services withsystemd-resolved. If you installed Homebridge using the officialapt package, this should be handled for you automatically. Otherwise, you'll need to do this manually. First, runpkcheck --version to see what version of Polkit you're running.

Polkit version 0.105 or lower

If the version is 0.105 or below, create a file in/etc/polkit-1/localauthority/30-site.d namedhomebridge.pkla with the following contents:

[Homebridge ManageService]Identity=unix-user:homebridgeAction=org.freedesktop.resolve1.register-service;org.freedesktop.resolve1.unregister-serviceResultAny=yes

If you run Homebridge as a different user thanhomebridge, you'll need to adjust theIdentity line accordingly.

Polkit version 0.106 or higher

If the version is 0.106 or higher, create a file in/etc/polkit-1/rules.d namedhomebridge.rules with the following contents:

polkit.addRule(function(action, subject) {    if ((action.id == "org.freedesktop.resolve1.register-service" ||        action.id == "org.freedesktop.resolve1.unregister-service") &&        subject.user == "homebridge") {        return polkit.Result.YES;    }});

If you run Homebridge as a different user thanhomebridge, you'll need to adjust the condition accordingly.

How To Set mDNS Advertiser

You can set the mDNS Advertiser from the settings section in the Homebridge UI:

Alternatively, you can manually add this to theconfig.json:

{"bridge":{// ..."advertiser":"ciao"// accepts "ciao" or "bonjour-hap" or "avahi" or "resolved"}}

How To Select Advertised Network Interfaces

If your Homebridge host has multiple network interfaces, it may be necessary to restrict, or manually choose, which interfaces are advertised by the mDNS services. This option affects both the addresses advertised via mDNS SD and the interface the HAP server TCP socket is bound to.

Note that this configuration only has an effect on the advertised addresses when using thebonjour-hap orciao advertiser.A more detailed explanation can be found in thetechnical documentation.

You can select the network interfaces Homebridge should advertise / listen from the "Homebridge Settings" section of the Homebridge UI:

Alternatively, you can manually add this to theconfig.json:

{"bridge":{// ..."bind":["eth0"]// accepts an array of network interface names or IP addresses}}

Installation

Homebridge Help

Homebridge UI Help

Versioning

Plugins

Developers

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp