From f87ebdb8ed800fb8ccc7e447aa0901e716979ede Mon Sep 17 00:00:00 2001 From: kn Date: Mon, 2 Aug 2021 01:29:27 +0000 Subject: Leave resolv.conf to resolvd if it learned nameservers During install (not upgrade) the installer parses resolv.conf looking for nameservers, FQDN and domain information; it also prompts for nameservers if none were found. If DHCP is used and nameservers were found, resolv.conf gets recreated from scratch. Under dhclient(8) this was fine, but resolvd(8) persists learned proposals across such file modifications and resolv.conf will thus contain a mix between managed and manual entries -- stale duplicates which users have to remove manually. Do not touch resolv.conf anymore in case resolvd knows better and thus provide a clean file for installations. OK florian --- distrib/miniroot/install.sub | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'distrib') diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index fb95222fef5..757b95ae469 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1169 2021/07/20 11:20:09 kn Exp $ +# $OpenBSD: install.sub,v 1.1170 2021/08/02 01:29:26 kn Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -2052,7 +2052,7 @@ set_term() { # Configure the network. donetconfig() { - local _dn _ns _f1 _f2 _f3 + local _dn _ns _f1 _f2 _f3 _autoconf_ns=false configure_ifs v4_defroute @@ -2065,6 +2065,7 @@ donetconfig() { # domain given on *last* search or domain statement. while read -r -- _f1 _f2 _f3; do [[ $_f1 == nameserver ]] && _ns="${_ns:+$_ns }$_f2" + [[ $_f3 == '# resolvd: '* ]] && _autoconf_ns=true [[ $_f1 == @(domain|search) ]] && _dn=$_f2 done