Browse Source

#697 simplify dns

v1.3
Christian Rotzoll 6 years ago
parent
commit
b32cef6e4d
  1. 19
      build_sdcard.sh

19
build_sdcard.sh

@ -83,20 +83,17 @@ else
fi
# setting static DNS server
# comment this block out if you are sure that your DNS conf works reliable
# see https://github.com/rootzoll/raspiblitz/issues/322#issuecomment-466733550
# check /etc/dhcpd.conf and /etc/dhcp/dhcpd.conf
if [ "${baseImage}" = "raspbian" ] || [ "${baseImage}" = "dietpi" ] ; then
# comment out any static dns entry if one is active
sudo sed -i "s/^static domain_name_servers=.*/#static domain_name_servers=/g" /etc/dhcpcd.conf
# add new dns config to conf file
echo "static domain_name_servers=1.1.1.1" | sudo tee -a /etc/dhcpcd.conf
fi
dnsconfFile="/etc/dhcpcd.conf"
if [ "${baseImage}" = "ubuntu" ]; then
# comment out any static dns entry if one is active
sudo sed -i "s/^static domain_name_servers=.*/#static domain_name_servers=/g" /etc/dhcp/dhcpd.conf
# add new dns config to conf file
echo "static domain_name_servers=1.1.1.1" | sudo tee -a /etc/dhcp/dhcpd.conf
dnsconfFile="/etc/dhcp/dhcpd.conf"
fi
# comment out any static dns entry if one is active
sudo sed -i "s/^static domain_name_servers=.*/#static domain_name_servers=/g" /etc/dhcpcd.conf
# add new dns config to conf file
echo "static domain_name_servers=1.1.1.1 8.8.8.8" | sudo tee -a /etc/dhcpcd.conf
# reload to activate for following network operations
systemctl daemon-reload
if [ "${baseImage}" = "raspbian" ] || [ "${baseImage}" = "dietpi" ] ; then

Loading…
Cancel
Save