Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

[feature request] Please add support of systemd built-in bonjour service (nss_resolve). #5452

Closed

Description

@enihcam

Please add support of systemd built-in bonjour service (nss_resolve). According to https://www.freedesktop.org/software/systemd/man/nss-resolve.html, systemd-resolved(nss_resolve) is the successor of avahi(nss_mdns).

Activity

  1. michaelrsweet commented on Dec 9, 2018

    @michaelrsweet
    Contributor

    Based on the available documentation, this is not a replacement for Avahi - all it does is handle resolving .local hostnames, but we also use Avahi for discovery.

  2. self-assigned this
    on Dec 9, 2018
  3. enihcam commented on Dec 9, 2018

    @enihcam
    Author

    @michaelrsweet systemd-resolved itself is a full Multicast DNS responder.
    https://systemd.network/resolved.conf.html#MulticastDNS=

  4. michaelrsweet commented on Dec 9, 2018

    @michaelrsweet
    Contributor

    @enihcam systemd-resolved does not support service browsing, which makes it useless for CUPS.

  5. michaelrsweet commented on Dec 9, 2018

    @michaelrsweet
    Contributor

    Please look at the DBUS API "documentation" provided for the systemd resolver - you'll notice an absence of anything that can be used to browse for service types or register a service instance and its TXT/LOC records. DNS-SD support is more than resolving the address for a name...

  6. michaelrsweet commented on Dec 9, 2018

    @michaelrsweet
    Contributor
  7. michaelrsweet commented on Dec 9, 2018

    @michaelrsweet
    Contributor

    And digging deeper I find that only systemd services can register DNS-SD records - there is no support for anything more...

  8. nursoda commented on May 6, 2020

    @nursoda

    According to https://www.freedesktop.org/wiki/Software/systemd/resolved/ , systemd-resolved does have service discovery implemented by now, right? I'm just asking here since https://wiki.archlinux.org/index.php/CUPS#Network still points to this issue stating that "CUPS does not support using systemd-resolved for DNS-SD".

    Not sure about your last comment on which services can register DNS-SD records though …

  9. michaelrsweet commented on May 7, 2020

    @michaelrsweet
    Contributor

    @nursoda systemd's resolved only handles mDNS hostname lookups (something.local) and not generic service discovery. WRT my comment two years ago about service registration, systemd supports registering a SRV and TXT record for a systemd service (e.g. a _ipps-system._tcp service registration for cupsd, if it supported the IPP System Service), but not "sub-services" under that systemd service (like the individual printer registrations to _ipp._tcp and _ipps._tcp), nor does it support DNS-SD sub-types (like _print._sub._ipp._tcp for IPP Everywhere), flagship naming (_printer._tcp is used to reserve service instance names for network printers).

  10. quentinmit commented on Apr 5, 2024

    @quentinmit

    @nursoda systemd's resolved only handles mDNS hostname lookups (something.local) and not generic service discovery. WRT my comment two years ago about service registration, systemd supports registering a SRV and TXT record for a systemd service (e.g. a _ipps-system._tcp service registration for cupsd, if it supported the IPP System Service), but not "sub-services" under that systemd service (like the individual printer registrations to _ipp._tcp and _ipps._tcp), nor does it support DNS-SD sub-types (like _print._sub._ipp._tcp for IPP Everywhere), flagship naming (_printer._tcp is used to reserve service instance names for network printers).

    systemd-resolved now supports both service discovery and runtime service registration.

    There's a blog post at https://daenney.github.io/2021/11/14/replacing-avahi-exploring-dnssd/ that explains how to do service discovery, but the gist is:

    $ dbus-send --system --print-reply --dest=org.freedesktop.resolve1 \
       /org/freedesktop/resolve1 \
       org.freedesktop.resolve1.Manager.ResolveRecord \
       int32:0 string:"_ipp._tcp.local" uint16:1 uint16:12 \
       uint64:0
    # then using one of the returned service names
    $ dbus-send --system --print-reply --dest=org.freedesktop.resolve1 \
       /org/freedesktop/resolve1 \
       org.freedesktop.resolve1.Manager.ResolveService \
       int32:0 string:"Printer Name" string:"_ipp._tcp" string:"local" \
       int32:2 \
       uint64:0
    

    and dynamic service registration is done with the RegisterService and UnregisterService methods.

    Can this issue please be reopened now that systemd-resolved appears to have the necessary discovery and advertisement features?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

wontfixThis will not be worked on

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions