public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lucas Barros <lucasbarros.kam@gmail.com>
To: pve-devel@lists.proxmox.com
Cc: t.lamprecht@proxmox.com, Lucas Barros <lucasbarros.kam@gmail.com>
Subject: [PATCH cluster/qemu-server/common v2 0/3] fix #6357: parse all search domains of resolv.conf
Date: Sun, 15 Nov 2026 22:00:10 -0300	[thread overview]
Message-ID: <20261116010014.88737-1-lucasbarros.kam@gmail.com> (raw)
In-Reply-To: <f981f39c-2604-4a34-9b0e-4fc0e0bb3373@proxmox.com>

The resolv.conf parser in pve-common only keeps the first domain of the
'search' line, so the DNS panel of a node shows only that one and saving
it again drops the others.

Thomas pointed out that the node certificate appends the value to the
node name [0]. I went through all users of the value (and of FQDNs
built from a search list) and used one rule: the API and the guests'
DNS settings get the whole list, an FQDN only uses the first domain.
That is what the certificates got so far, as the parser only returned
the first domain.

* 1/3 pve-cluster: node certificate uses the first domain; has to be
  applied before 3/3
* 2/3 qemu-server: cloud-init 'fqdn' used the whole 'searchdomain' of
  the VM ('vm.a.example b.example'); independent of 3/3, same mistake
* 3/3 pve-common: the parser fix, unchanged code from v1

Other users need no change: the cloud-init and container setup code
already split the value into a list, pveperf reads resolv.conf on its
own, and PVE::Notify takes its FQDN from getaddrinfo(). Details in the
notes of 3/3.

Tested on a PVE 9 node (pve-cluster 9.1.9, qemu-server 9.2.15,
libpve-common-perl 9.2.8, files patched in place), search domains set
with resolvectl, certificate regenerated with 'pvecm updatecerts
--force':

                       GET .../dns   cert CN / DNS SAN    cloud-init
                       search                             fqdn (*)
  stock, 1 domain      dom           node.dom             vm.x y
  stock, 3 domains     dom           node.dom             vm.x y
  3/3 only, 3 domains  dom b c       node.dom b c (bad)   vm.x y
  1-3/3, 3 domains     dom b c       node.dom             vm.x
  1-3/3, 1 domain      dom           node.dom             vm.x

  (*) VM with 'searchdomain: x y'

With 3/3 VMs without their own DNS settings get all three domains in
the network config, before only the first. pveproxy came up with every
certificate. 'make check' in pve-common passes before and after (the
new test fails 3 of 7 without 3/3), the qemu-server tests give the
same result before and after, proxmox-perltidy reports no changes.

The Rust side has the same first-domain-only parser in proxmox-dns-api
(used by PDM) and in proxmox-backup, and builds the FQDN of the
self-signed certificate (and of the PBS notification links) the same
way. So it is consistent with the old behavior. I have patches to
align it with this rule and can send them to pbs-devel/pdm-devel if
you want that.

v1: https://lore.proxmox.com/pve-devel/20261107223019.21361-1-lucasbarros.kam@gmail.com/

[0] https://lore.proxmox.com/pve-devel/f981f39c-2604-4a34-9b0e-4fc0e0bb3373@proxmox.com/

This series was prepared with the help of an LLM based coding
assistant; I reviewed the changes and ran the tests mentioned above
myself.

cluster:

Lucas Barros (1):
  setup: node certificate: only use the first search domain for the FQDN

 src/PVE/Cluster/Setup.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

qemu-server:

Lucas Barros (1):
  cloudinit: only use the first search domain for the FQDN

 src/PVE/QemuServer/Cloudinit.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

common:

Lucas Barros (1):
  fix #6357: inotify: resolv.conf: parse all search domains

 src/PVE/INotify.pm       |  4 +--
 test/Makefile            |  1 +
 test/resolv_conf_test.pl | 65 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 68 insertions(+), 2 deletions(-)
 create mode 100755 test/resolv_conf_test.pl

--
2.50.1 (Apple Git-155)



  reply	other threads:[~2026-11-16  1:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07 22:30 [PATCH common] fix #6357: inotify: resolv.conf: parse all search domains Lucas Barros
2026-11-11 23:15 ` Thomas Lamprecht
2026-11-16  1:00   ` Lucas Barros [this message]
2026-11-16  1:00     ` [PATCH cluster v2 1/3] setup: node certificate: only use the first search domain for the FQDN Lucas Barros
2026-11-16  1:00     ` [PATCH qemu-server v2 2/3] cloudinit: " Lucas Barros
2026-11-16  1:00     ` [PATCH common v2 3/3] fix #6357: inotify: resolv.conf: parse all search domains Lucas Barros
2026-11-16  1:48     ` [PATCH cluster/qemu-server/common v2 0/3] fix #6357: parse all search domains of resolv.conf Thomas Lamprecht
2026-11-16 13:32     ` superseded: " Lucas Barros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116010014.88737-1-lucasbarros.kam@gmail.com \
    --to=lucasbarros.kam@gmail.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal