mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-04-01 08:28:20 +02:00
#697 simplify dns
This commit is contained in:
parent
5e2b3d8d53
commit
b32cef6e4d
@ -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…
x
Reference in New Issue
Block a user