Fedora-OSTree-Setup-dev / Fedora-OSTree-Setup

Glorified scipt that automates the setup of Fedora Silverblue/Kinoite based on given config file.
GNU General Public License v3.0
7 stars 3 forks source link

Change DNS Server #76

Open boredsquirrel opened 1 year ago

boredsquirrel commented 1 year ago
sudo sed -i 's/#DNS=/DNS=194.242.2.2/g' /etc/systemd/resolved.conf
sudo sed -i 's/#FallbackDNS=/FallbackDNS=193.19.108.2/g' /etc/systemd/resolved.conf

make this interactive:

while true; do
    read -p "Your local DNS server will be set to 'MullvadDNS without Content Block', do you want to change that?" yn
    case $yn in
        [YyjJ]* ) read -p "DNS: " DNS 
        read -p "FallbackDNS: " FDNS 
        sudo sed -i 's/#DNS=/DNS=$DNS/g' /etc/systemd/resolved.conf
        sudo sed -i 's/#FallbackDNS=/FallbackDNS=$FDNS/g' /etc/systemd/resolved.conf&& break;;
        [Nn]* ) sudo sed -i 's/#DNS=/DNS=194.242.2.2/g' /etc/systemd/resolved.conf
        sudo sed -i 's/#FallbackDNS=/FallbackDNS=193.19.108.2/g' /etc/systemd/resolved.conf && break;;
        * ) echo "Please answer yes or no.";;
    esac
done

German site for DNS servers (Europe-centric)

boredsquirrel commented 1 year ago

please add this to the privacy tracker if there is one

boredsquirrel commented 1 year ago

add more security configs:

sudo sed -i 's/#DNSSEC=no/DNSSEC=yes/g' /etc/systemd/resolved.conf
sudo sed -i 's/#DNSOverTLS=no/DNSOverTLS=opportunistic/g' /etc/systemd/resolved.conf
sudo sed -i 's/#Cache=yes/Cache=yes/g' /etc/systemd/resolved.conf

systemctl restart systemd-resolved.service

echo "You can view statistics with 'resolvectl statistics'"
boredsquirrel commented 1 year ago

https://www.freedesktop.org/software/systemd/man/resolved.conf.html

https://www.baeldung.com/linux/configure-dns-caching