1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 06:48:07 +00:00

unbind resolved on ubuntu 18.04

Stop systemd-resolved from interfering with dnsmasq/ftl
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
This commit is contained in:
Rob Gill 2018-05-14 19:38:12 +10:00 committed by GitHub
parent b1ab7f46e0
commit adf2275018
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2304,6 +2304,25 @@ main() {
fi
fi
# resolved and dnsmasq can't share port 53.
# resolved needs to remain in place for installer to download needed files
# so this change needs to be made after installation is complete, but before resarting dnsmasq/ftl
# Check if running ubuntu 18.04 bionic beaver, which ships with resolved active on port 53
# (This check may need to be broadened for other systems running resolved?)
if ( lsb_release -a | grep 'Ubuntu 18.04' &> /dev/null ); then
# Running ubuntu 18.04, so check if resolved is running,
if (systemctl is-enabled systemd-resolved | grep -c 'enabled' || true); then
# if resolveconf is running unbind it from port 53
# Note that this breaks dns functionality on host until dnsmasq/ftl are up and running
echo -e "Unbinding resolved from port 53"
# Make a backup of the original /etc/systemd/resolveconf.d
# (This will need to be restored on uninstallation)
sed -i.orig 's/#DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf
systemctl restart systemd-resolved
fi
fi
# Enable FTL
start_service pihole-FTL
enable_service pihole-FTL