mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 23:08:07 +00:00
Add ability to choose upstream DNS servers
Give the user the ability to choose between Google and DynDNS upstream servers. Then insert the chosen DNS servers in to /etc/dnsmasq.d/01-pihole.conf. Todo: extend choices to include manually entered DNS servers.
This commit is contained in:
parent
abef758ff6
commit
6cf6e16d22
@ -260,6 +260,26 @@ setStaticIPv4(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setDNS(){
|
||||||
|
DNSChoseCmd=(whiptail --separate-output --radiolist "Select DNS Servers" $r $c 2)
|
||||||
|
DNSChooseOptions=(Google "Use Google's DNS Servers" on
|
||||||
|
DynDNS "Use DynDNS's DNS Servers" off)
|
||||||
|
DNSchoices=$("${DNSChoseCmd[@]}" "${DNSChooseOptions[@]}" 2>&1 >/dev/tty)
|
||||||
|
|
||||||
|
case $DNSchoices in
|
||||||
|
Google)
|
||||||
|
echo "Google selected."
|
||||||
|
piholeDNS1="8.8.8.8"
|
||||||
|
piholeDNS2="8.8.4.4"
|
||||||
|
;;
|
||||||
|
DynDNS)
|
||||||
|
echo "DynDNS selected."
|
||||||
|
piholeDNS1="208.67.222.222"
|
||||||
|
piholeDNS2="208.67.220.220"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
+versionCheckDNSmasq(){
|
+versionCheckDNSmasq(){
|
||||||
# Check if /etc/dnsmasq.conf is from pihole. If so replace with an original and install new in .d directory
|
# Check if /etc/dnsmasq.conf is from pihole. If so replace with an original and install new in .d directory
|
||||||
dnsFile="/etc/dnsmasq.conf"
|
dnsFile="/etc/dnsmasq.conf"
|
||||||
@ -271,6 +291,8 @@ setStaticIPv4(){
|
|||||||
fi
|
fi
|
||||||
$SUDO cp /etc/.pihole/advanced/01-pihole.conf /etc/dnsmasq.d/01-pihole.conf
|
$SUDO cp /etc/.pihole/advanced/01-pihole.conf /etc/dnsmasq.d/01-pihole.conf
|
||||||
$SUDO sed -i "s/@INT@/$piholeInterface/" /etc/dnsmasq.d/01-pihole.conf
|
$SUDO sed -i "s/@INT@/$piholeInterface/" /etc/dnsmasq.d/01-pihole.conf
|
||||||
|
$SUDO sed -i "s/@DNS1@/$piholeDNS1/" /etc/dnsmasq.d/01-pihole.conf
|
||||||
|
$SUDO sed -i "s/@DNS2@/$piholeDNS2/" /etc/dnsmasq.d/01-pihole.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
installScripts(){
|
installScripts(){
|
||||||
@ -484,7 +506,8 @@ chooseInterface
|
|||||||
# Let the user decide if they want to block ads over IPv4 and/or IPv6
|
# Let the user decide if they want to block ads over IPv4 and/or IPv6
|
||||||
use4andor6
|
use4andor6
|
||||||
|
|
||||||
|
# Decide what upstream DNS Servers to use
|
||||||
|
setDNS
|
||||||
|
|
||||||
# Install and log everything to a file
|
# Install and log everything to a file
|
||||||
installPihole | tee $tmpLog
|
installPihole | tee $tmpLog
|
||||||
|
Loading…
Reference in New Issue
Block a user