From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 9857B1FF0E1 for ; Mon, 16 Nov 2026 02:00:36 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 8AC18216ED; Mon, 16 Nov 2026 02:00:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794790821; x=1795395621; darn=lists.proxmox.com; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=e41wAAWVOLDQ6UnHsQeujjM4IRB9xdIMfUzer1sviCs=; b=oK6Cq2usITXs7H7JAV5ce2sR0c+TqXoLt/GNk7rUXerhNvg7Mlr8R3Z2eSNW3m7dJL XYcwpGXeChXB0AhMV5rRklRC213O+B3UY6yxTC1n6eAwRgG73vC2FYtXKi8XCR8bAuGV tbhUiHgYIIoIj+wZXZubK0iOKxxZ3/BJEZFBEv+R/7cM5jTLhICXuy6Xls1SpTmzSSks rQc+0Hw5+u+AztF7alw9YWfUAusKo2P2ZkP5fz8ER9Jpex12pJfawosL6nTngeNqirDY /O0fR02vSKR7fBnTt7ItUPE+nKtfjZ5ps9O9X8qEHT/trjlfC3PuchazBF6CVKUSRPMv BJgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794790821; x=1795395621; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=e41wAAWVOLDQ6UnHsQeujjM4IRB9xdIMfUzer1sviCs=; b=RR5hpvj//A1Q47eMfEOgIchfGWwZtT1jNxaGJKC0kXNUTAqVjYfjgyvZtSUfigOzYT geFH0dPu+dNe7+Usux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4vJCVqTjmQzvQbEHuZEexJKgfIZ/ X-Received: by 2002:a05:6122:ca5:b0:5ea:aedd:6077 with SMTP id 71dfb90a1353d-5ee34a7922dmr2211490e0c.5.1794790821159; Sun, 15 Nov 2026 17:00:21 -0800 (PST) From: Lucas Barros To: pve-devel@lists.proxmox.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 Message-ID: <20261116010014.88737-1-lucasbarros.kam@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.120 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: IVVX7O2VO73FPU5X2OZKBSQ4U7ICSZ6Z X-Message-ID-Hash: IVVX7O2VO73FPU5X2OZKBSQ4U7ICSZ6Z X-MailFrom: lucasbarros.kam@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: t.lamprecht@proxmox.com, Lucas Barros X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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)