Skip to content

Is there a way to add new commands to resolvectl in a plugin-like fashion #24532

Open

Description

@schanzen

We are developing an alternative name resolution protocol and I was wondering if it is possible to "plug in" to systemd-resolvd or resolvectl similar to how glibc supports this and how we do it through nsswitch in order to resolve names?
This may also be interesting for other systems such as ENS or Handshake.

E.g.

$ resolvectl gns pizza.foo.gns

Activity

  1. added
    RFE 🎁
    on Sep 2, 2022
  2. keszybz commented on Dec 6, 2022

    @keszybz
    Member

    No, there is no plan for this. If anything, we would extend systemd-resolved. resolvectl is just a thin client for it. But this would require completely redesigning how systemd-resolved works. Right now it has very tight integration between different components (e.g. how lookup using mDNS, LLMNR, DNS, /etc/hosts is done in various places).

  3. poettering commented on Dec 6, 2022

    @poettering
    Member

    Oh, actually, I think we totally should add a concept for this, similar to how userdbd multiplexing works: provide a dir that other components can place AF_UNIX sockets in, speaking varlink, that we'll send each query to, and give a chance to respond to.

    systemd-machined would be one of the components that should hook themselves into resolved that way.

  4. schanzen commented on Dec 14, 2022

    @schanzen
    Author

    Looking at the upcoming .alt TLD I wonder if a concept of suffix-matching of those plugins may be worth considering.
    What I mean is that you call

    $ resolvectl resolve example.foo.alt
    

    and there may be a mechanism such as the one you outlined above that checks if any socket responds to this name or a suffix of it as opposed to having dedicated named plugins.
    In the spirit of the draft this would allow name systems to claim .alt sub namespaces such as ens.alt or gns.alt (but also .eth or .gns depending on the configuration.

    Another option would be integrate a single "alt" option

    $ resolvectl alt example.foo.alt
    

    and the "alt"-component itself would then allow third parties to plug into the resolution process instead of plugging directly into resolve{ctl,d}.

    FWIW I would be willing to help or give it a shot if you can give me some pointers.

    EDIT: Note that the second option is a bit incomplete from the point of view of the alternative name systems as ".alt" is only meant to prevent namespace clashed with DNS but may not encompass the whole namespace of the alternative name system.

  5. lf- commented on May 3, 2023

    @lf-
    Contributor

    Oh, actually, I think we totally should add a concept for this, similar to how userdbd multiplexing works: provide a dir that other components can place AF_UNIX sockets in, speaking varlink, that we'll send each query to, and give a chance to respond to.

    systemd-machined would be one of the components that should hook themselves into resolved that way.

    FWIW this use case is either #8518 or #20485 and I think this bug is probably worth closing. (also lol re machined, since docker has persistently Not had anything like this and it's really frustrating. if there was a composable mechanism to extend the system DNS it would be fantastic)

  6. schanzen commented on May 3, 2023

    @schanzen
    Author

    Oh, actually, I think we totally should add a concept for this, similar to how userdbd multiplexing works: provide a dir that other components can place AF_UNIX sockets in, speaking varlink, that we'll send each query to, and give a chance to respond to.
    systemd-machined would be one of the components that should hook themselves into resolved that way.

    FWIW this use case is either #8518 or #20485 and I think this bug is probably worth closing. (also lol re machined, since docker has persistently Not had anything like this and it's really frustrating. if there was a composable mechanism to extend the system DNS it would be fantastic)

    Well, I agree that this is an RFE, but the fix (or rather the only comment) in #8518 do not really work today: Option 1 and 2 are not possible because of #21174 . Option 3 irrelevant for systemd.

    I still think as mentioned in this issue there should be an extension in systemd, and having unix sockets that do that seems like a fine idea to me as well.

    Note that in general this issue goes beyond DNS. (See the .alt draft I referenced).

  7. lf- commented on May 3, 2023

    @lf-
    Contributor

    I wrote a more extensive comment in #8518, but I absolutely agree with this, it's just that this particular issue is asking for extending resolvectl rather than resolved behaviour; the latter is better placed in #8518 or this one should be renamed. Every subsystem of the Linux system needs to have one composable extension point, and the Unix socket idea sounds amazing to me too.

  8. lf- commented on May 3, 2023

    @lf-
    Contributor

    nsswitch seems kind of a kind of ... janky solution for 2023, when C is no longer the only language around so shared libraries are not an ideal interface, especially with Go, etc. Thus the Unix socket concept seems more feasible.

  9. schanzen commented on Mar 5, 2024

    @schanzen
    Author
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

    RFE 🎁resolve

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions