NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/59836: 11.0_BETA: resolvconf fails with 'eval: make_vars: IP_OF_2ND_DNS: not found' for more than 1 dns server



>Number:         59836
>Category:       bin
>Synopsis:       11.0_BETA: resolvconf fails with 'eval: make_vars: IP_OF_2ND_DNS: not found' for more than 1 dns server
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 14 20:25:00 +0000 2025
>Originator:     Henryk Paluch
>Release:        NetBSD 11.0_BETA (GENERIC) #0: Fri Dec 12 19:34:43 UTC 2025
>Organization:
N/A
>Environment:
NetBSD nbsd-x2 11.0_BETA NetBSD 11.0_BETA (GENERIC) #0: Fri Dec 12 19:34:43 UTC 2025  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
When resolvconf is run and you have more than 1 DNS server of same class (IPv4 or IPv6) from DHCP server, it will just throws error:

nbsd-x2# /sbin/resolvconf -u
eval: make_vars: 78.157.167.57: not found
eval: make_vars: 2a02:d8a0:2::: not found

and generates empty /etc/resolv.conf (no DNS servers defined)

It is because it improperly adds single quotes around each item of NAMESERVERS variables that later cause eval issue.

Warning: This error occurs only if there is more than one nameserver in specific class (at least 2 IPv4 nameservers or at least 2 IPv6 nameservers returned by DHCP server).
>How-To-Repeat:
You need to have DHCP server that returns at least 2 IPv4 DNS servers or at least 2 IPV6 DNS servers and  then:

Run

 /sbin/resolvconf -u

on latest NetBSD 11 Beta (tested 20251212193443Z) you will get errors:

eval: make_vars: 78.157.167.57: not found
eval: make_vars: 2a02:d8a0:2::: not found

Where 78.157.167.57 is my 2nd IPv4 DNS server (1st is OK) and 2a02:d8a0:2::: is my 2nd IPv6 DNS.

After this error - generated /etc/resolv.conf is empty:

# Generated by resolvconf

While using fixed resolvconf or older NetBSD 10.1 - generated /etc/resolv.conf contains all DNS servers (in my case 2 IPv4 and 2 IPv6):

# Generated by resolvconf
nameserver 78.157.167.7
nameserver 78.157.167.57
nameserver 2a02:d8a0:1::
nameserver 2a02:d8a0:2::



>Fix:
I use following patch (inspired by NetBSD 10.1 resolvconf that works properly) to fix it:

--- sbin/resolvconf.orig        2025-12-14 11:14:03.422798639 +0100
+++ sbin/resolvconf     2025-12-14 21:00:51.731497397 +0100
@@ -31,7 +31,7 @@ LIBEXECDIR=/libexec/resolvconf
 VARDIR=/var/run/resolvconf
 RCDIR=/etc/rc.d
 RESTARTCMD=
-
+#set -x
 if [ "$1" = "--version" ]; then
        echo "openresolv $OPENRESOLV_VERSION"
        echo "Copyright (c) 2007-2025 Roy Marples"
@@ -334,7 +334,8 @@ parse_resolv()
                                printf '%s\n' "SEARCH=\"\$SEARCH \"$search"
                        fi
                        if ! $private; then
-                               printf '%s\n' "NAMESERVERS=\"\$NAMESERVERS \"$ns"
+                               ns=$( echo "$ns" | tr -d "'" )
+                               echo "NAMESERVERS=\"\$NAMESERVERS $ns\""
                        fi
                        ns=
                        search=



Home | Main Index | Thread Index | Old Index