Skip to content

resolved: add varlink API for resolving raw RRs - #31616

Merged
bluca merged 2 commits into
systemd:mainfrom
poettering:resolved-varlink-resolve-record
Mar 7, 2024
Merged

bluca merged 2 commits into
systemd:mainfrom
poettering:resolved-varlink-resolve-record

Conversation

@poettering

Copy link
Copy Markdown
Member

This includes commits from #31580 and #31613, since this PR touches lines also included in those PR.

Those other PRs should be merged before this one hence.

@github-actions github-actions Bot added util-lib tests please-review PR is ready for (re-)review by a maintainer labels Mar 4, 2024
@poettering poettering added do-not-merge 💣 and removed please-review PR is ready for (re-)review by a maintainer labels Mar 4, 2024
@poettering
poettering force-pushed the resolved-varlink-resolve-record branch from 87a0052 to e40d1c8 Compare March 4, 2024 13:51
@github-actions github-actions Bot added escape please-review PR is ready for (re-)review by a maintainer labels Mar 4, 2024
@poettering
poettering force-pushed the resolved-varlink-resolve-record branch from e40d1c8 to e021b96 Compare March 4, 2024 15:21
@bluca bluca added needs-rebase and removed please-review PR is ready for (re-)review by a maintainer labels Mar 4, 2024
@poettering
poettering force-pushed the resolved-varlink-resolve-record branch from e021b96 to e3f2ccb Compare March 5, 2024 14:46
@poettering poettering added please-review PR is ready for (re-)review by a maintainer and removed needs-rebase labels Mar 5, 2024
@bluca bluca added needs-rebase and removed please-review PR is ready for (re-)review by a maintainer labels Mar 6, 2024
…solve interface

Let's define this in the generic interface and then import it into the
Monitor interface too.

This is preparation for adding an interface to resolve arbitrary RRs via
Varlink, which means we want the type in both interfaces.
Now that we have an address, hostname, and service resolve, at the last
kind of resovler we expose over D-Bus also to Varlink.
@poettering
poettering force-pushed the resolved-varlink-resolve-record branch from e3f2ccb to cf1c8cd Compare March 6, 2024 18:02
@github-actions github-actions Bot added please-review PR is ready for (re-)review by a maintainer and removed needs-rebase labels Mar 6, 2024
@bluca bluca added good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed and removed please-review PR is ready for (re-)review by a maintainer labels Mar 6, 2024
@bluca
bluca merged commit 6d1321c into systemd:main Mar 7, 2024
@github-actions github-actions Bot removed the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Mar 7, 2024
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Nov 17, 2026
Currently, the DNS test in Arch Linux containers fails on Ubuntu 22.04
hosts:
  not ok 184 network: DNS inside Arch Linux in 715ms
  # tags: arch-fedora runtime-environment
  # (from function `assert_line' in file
       test/system/libs/bats-assert/src/assert.bash, line 488,
  #  in test file test/system/203-network.bats, line 283)
  #   `assert_line --index 0 "$ipv4_addr"' failed
  #
  # -- line differs --
  # index    : 0
  # expected : 193.0.14.129
  # actual   :
  # --
  #

This is because the underlying resolvectl(1) invocation fails:
  $ resolvectl --legend false --no-pager --type A query
        k.root-servers.net
  k.root-servers.net: resolve call failed:
      org.varlink.service.MethodNotFound

In systemd 262, resolvectl(1) was changed to communicate with
systemd-resolved(8) using Varlink APIs instead of their D-Bus
counterparts.  One of them was the ResolveRecord method [1], known as
io.systemd.Resolve.ResolveRecord in the Varlink API and as
org.freedesktop.resolve1.Manager.ResolveRecord in the D-Bus variant.

However, the ResolveRecord method was only exposed through Varlink in
systemd 256 [2] and Ubuntu 22.04 only has systemd 249.  This breaks the
compatibility between resolvectl(1) and systemd-resolved(8).

It seems that these days the arch-toolbox image includes python3(1),
which it originally didn't, and the nss-resolve(8) plugin for the GNU
Name Service Switch (or NSS) functionality of the GNU C Library doesn't
use ResolveRecord.  Therefore, resolvectl(1) can be replaced by using
getaddrinfo(3), which is a front-end to nss-resolve(8), through
python3(1).

[1] systemd commit cfac7ec169892b38
    systemd/systemd@cfac7ec169892b38
    systemd/systemd#41840

[2] systemd commit cf1c8cdb87d4e2c1
    systemd/systemd@cf1c8cdb87d4e2c1
    systemd/systemd#31616

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

Development

Successfully merging this pull request may close these issues.

2 participants