Skip to content

resolvectl: Add a way to show resolved's cache entries #14796

Description

@daandemeyer

Is your feature request related to a problem? Please describe.

resolvectl doesn't seem to provide a command to show a list of discovered hosts on the local network (cache entries).

Describe the solution you'd like

Add a command to resolvectl that lists the entries in the resolved cache.

From a quick look at resolved's code, it seems we'd need to add a dbus call to retrieve the entries from resolved's cache which would take a few filtering options to allow filtering the output (just like the ResolveHostname dbus call). In the dbus call we'd simply iterate over the necessary dns scope caches and construct a response.

What I'm not so sure about is how we'd best expose this in resolvectl's CLI. Two possible options that I can see:

  1. Add a table with cache entries to the status output produced by resolvectl's mdns, llmnr and dns commands.
  2. Add a explicit command (resolvetctl discover (like avahi-discover), resolvectl dump, ...) that lists all entries from all caches and allow filtering with the existing -i, -p, -4, -6, ... options.

I'm leaning towards the second option because it provides greater flexibility but I would be fine with either one.

Any opinions? This seems doable to implement on my own so I can have a go at it but it would be great to know if something like this would be accepted.

Activity

  1. yuwata commented on Feb 5, 2020

    @yuwata
    Member

    I like the idea. Please implement that.

  2. added
    RFE 🎁
    on Feb 5, 2020
  3. dimyme commented on Oct 9, 2020

    @dimyme

    meanwhile (not sure about local entries), use
    sudo killall -USR1 systemd-resolved # dump cache and keep going
    the output will be redirected to journald in "cockpit" at
    http://localhost:9090/system/logs#/?prio=debug&service=systemd-resolved.service&tag=systemd-resolved

  4. q2dg commented on Dec 11, 2021

    @q2dg

    I think this issue should be reopened until a final solution is achieved

  5. added 2 commits that reference this issue on Jun 12, 2023
    9336ee7
    e0930aa
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