unbound: use ipv4 on older ubuntu
SpamHaus rejects queries from ipv6. unbound does not work on ipv6 only servers without do-ip6: true prefer-ip4 only works on ubuntu 24 this leads to a situation that we cannot support ipv6 only servers with older ubuntu
This commit is contained in:
@@ -94,10 +94,12 @@ systemctl restart systemd-journald
|
||||
usermod -a -G adm ${USER}
|
||||
|
||||
log "Setting up unbound"
|
||||
rm -f /etc/unbound/unbound.conf.d/prefer-ip4.conf # old config file
|
||||
cp -f "${script_dir}/start/unbound/unbound.conf" /etc/unbound/unbound.conf.d/cloudron-network.conf
|
||||
unbound_version=$(unbound -V | sed -n 's/^Version \([0-9.]*\)/\1/p')
|
||||
if vergte "${unbound_version}" "1.19.2"; then
|
||||
cp "${script_dir}/start/unbound/prefer-ip4.conf" /etc/unbound/unbound.conf.d/cloudron-prefer-ip4.conf
|
||||
if [[ "${ubuntu_version}" == "20.04" || "${ubuntu_version}" == "22.04" ]]; then
|
||||
# on older ubuntu, prefer-ip4 option does not exist. do-ip6 has to be disabled because SpamHaus rejects IPv6 queries
|
||||
# this means we cannot support IPv6 only servers on older ubuntu
|
||||
sed -e 's/do-ip6: yes/do-ip6: no/' -e 's/prefer-ip4:/# prefer-ip4:/' -i /etc/unbound/unbound.conf.d/cloudron-network.conf
|
||||
fi
|
||||
rm -f /etc/unbound/unbound.conf.d/remote-control.conf # on ubuntu 24
|
||||
|
||||
|
||||
Reference in New Issue
Block a user