Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
enihcam opened this issue Dec 9, 2018 · 9 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@enihcam
Copy link

enihcam commented Dec 9, 2018

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).

@michaelrsweet
Copy link
Collaborator

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.

@michaelrsweet michaelrsweet self-assigned this Dec 9, 2018
@michaelrsweet michaelrsweet added the wontfix This will not be worked on label Dec 9, 2018
@enihcam
Copy link
Author

enihcam commented Dec 9, 2018

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

@michaelrsweet
Copy link
Collaborator

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

@michaelrsweet
Copy link
Collaborator

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...

@michaelrsweet
Copy link
Collaborator

@michaelrsweet
Copy link
Collaborator

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

@nursoda
Copy link

nursoda commented May 6, 2020

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 …

@michaelrsweet
Copy link
Collaborator

@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).

@quentinmit
Copy link

@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
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants