Skip to content

Commit

Permalink
testing custom dns in the wizard for test
Browse files Browse the repository at this point in the history
  • Loading branch information
mosajjal committed Dec 10, 2023
1 parent 135f0fb commit 00eb4f5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 00eb4f5

Please sign in to comment.