Workaround resolved breaking the resolution

systemd-resolved does not provide DNSSEC entries in default
configuration. Workaround that by using servers used by it, but not the
resolved itself.
This commit is contained in:
Petr Menšík 2022-06-06 13:49:25 +02:00
commit 426b3debbb

View file

@ -38,14 +38,22 @@ rlJournalStart
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlRun "RESOLV_CONF=$(realpath /etc/resolv.conf)"
if [ "$RESOLV_CONF" = "/run/systemd/resolve/stub-resolv.conf" ]; then
rlLog "systemd-resolved is known to break dnssec. Switching to remote resolvers."
rlRun "rm -f /etc/resolv.conf"
RESOLV_CONF_ORIG="$RESOLV_CONF"
RESOLV_CONF=/run/systemd/resolve/resolv.conf
rlRun "ln -s $RESOLV_CONF /etc/resolv.conf" 0 "Link to non-stub resolv.conf"
fi
rlPhaseEnd
rlPhaseStartTest
rm -rf log
for i in $ListSha1Signed;do
rlLog "trying $i"
if unbound-host ietf.org;then
rlRun "unbound-host -rD $i &> log"
if unbound-host -vr ietf.org;then
rlRun "unbound-host -rvD $i &> log"
rlRun "grep 'failure' log" 1-255
rlRun "grep 'has address' log"
cat log
@ -57,6 +65,10 @@ rlJournalStart
rlPhaseEnd
rlPhaseStartCleanup
if [ -n "$RESOLV_CONF_ORIG" ]; then
rlRun "rm -f /etc/resolv.conf"
rlRun "ln -s $RESOLV_CONF_ORIG /etc/resolv.conf" 0 "Link to non-stub resolv.conf"
fi
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd