#!/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 <rpe@openbsd.org>
# Configure the network.
donetconfig() {
- local _dn _ns _f1 _f2 _f3
+ local _dn _ns _f1 _f2 _f3 _autoconf_ns=false
configure_ifs
v4_defroute
# 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 </etc/resolv.conf
fi
fi
hostname "$(hostname -s).$resp"
+ if $_autoconf_ns && [[ -n $_ns ]]; then
+ echo "Using DNS nameservers at $_ns"
+ return
+ fi
+
# Get & add nameservers to /tmp/resolv.conf. Don't ask if there's only
# one configured interface and if it's managed by dhcp and if the
# nameserver is configured via dhcp too.