Skip to content

macOS: JmDNS advertiser cannot bind UDP 5353 (mDNSResponder); need native DNS-SD path #212

Open

Description

@kgoderis

Problem

On macOS, Apple's mDNSResponder exclusively owns UDP 5353. HAP-Java's default advertising path creates a dedicated JmDNS instance that tries to bind that port, which fails with Address already in use / "no suitable mDNS". Controllers never see _hap._tcp even when the HAP TCP listener is up.

Verified locally:

  • lsof / bind attempts show 5353 is unavailable to the JVM
  • dns-sd -B _hap._tcp stays empty while using JmDNS-only advertising

Proposed direction

Add a pluggable HomekitAdvertiser and a native DNS-SD implementation that calls DNSServiceRegister via JNA (Bonjour IPC) so _hap._tcp is published without binding 5353. Keep existing JmDNS constructors for backward compatibility.

Context

Fork / WIP: https://github.com/kgoderis/HAP-Java/tree/feature/native-dnssd-advertiser
Docs draft: https://github.com/kgoderis/HAP-Java/blob/feature/native-dnssd-advertiser/docs/NATIVE_DNSSD.md

Activity

  1. added 3 commits that reference this issue on Oct 22, 2026
    175f81a
    fb1842f
    9c032ca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions