This seems to work, Ubuntu is hoarding port 53 though even though local services are shut off.

This commit is contained in:
2023-07-29 12:49:12 -07:00
parent bcc914d77a
commit 0915d7a018
4 changed files with 108 additions and 8 deletions

44
Config/DNS/undo.sh Executable file
View File

@@ -0,0 +1,44 @@
# 2023-07-29
# Config/DNS/undo.sh
# Easy way to stop using this container.
function start-service {
service=""
if [[ -n $1 ]]; then
service=$1
else
echo "ERROR: A parameter was not provided for start-service, aborting."
exit 1
fi
if [[ -n $2 ]]; then
echo "ERROR: A second parameter to start-service is not expected, aborting."
exit 1
fi
systemctl enable --now $service &&
echo "$service started successfully!" ||
echo "$service was not found, no problem."
}
echo -e "\n*** Stop the docker container ***"
docker compose down
echo -en "\n*** Restore the DNS file "
if [[ -e /etc/resolv.conf.save ]]; then
echo "from backup ***"
cp /etc/resolv.conf.save /etc/resolv.conf
else
echo "with Cloudflare ***"
echo "nameserver 1.1.1.1" > /etc/resolv.conf
echo "nameserver 1.0.0.1" >> /etc/resolv.conf
echo "options rotate" >> /etc/resolv.conf
fi
echo "/etc/resolv.conf:"
cat /etc/resolv.conf
echo -e "\n*** Turn on any local DNS programs ***"
start-service systemd-resolved
start-service dnsmasq
# Finish
echo " "
exit 0