From 00eb4f5b3d05caa7110c897c3e5ea32d42949a5b Mon Sep 17 00:00:00 2001 From: Ali Mosajjal Date: Sun, 10 Dec 2023 19:14:46 +1300 Subject: [PATCH] testing custom dns in the wizard for test --- install.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index a4785e3..0ff9f0f 100644 --- a/install.sh +++ b/install.sh @@ -28,8 +28,13 @@ fi # prompt before removing stub resolver echo "This script will remove the stub resolver from /etc/resolv.conf" echo "and replace it with 9.9.9.9" -echo "Press Ctrl-C to abort or Enter to continue" -read +echo "Press Ctrl-C to abort or Enter to replace the DNS server with 9.9.9.9, otherwise enter your preffered DNS server and press Enter" +read dnsServer + +# if dnsServer is empty, replace it with 9.9.9.9 +if [ -z "$dnsServer" ]; then + dnsServer="9.9.9.9" +fi # check to see if sed is installed if ! command -v sed &> /dev/null; then @@ -38,7 +43,7 @@ if ! command -v sed &> /dev/null; then fi # remove stub resolver -sed -i 's/#DNS=/DNS=9.9.9.9/; s/#DNSStubListener=yes/DNSStubListener=no/' /etc/systemd/resolved.conf +sed -i 's/#DNS=/DNS='$dnsServer'/; s/#DNSStubListener=yes/DNSStubListener=no/' /etc/systemd/resolved.conf systemctl restart systemd-resolved # check if stub resolver is removed by checking netstat for port 53 udp. try both ss and netstat