mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-24 22:00:17 +00:00
dnsmasq "domain-needed" property
This commit is contained in:
parent
ba015c1918
commit
85e3f37503
1 changed files with 13 additions and 1 deletions
|
@ -72,7 +72,7 @@ SetWebPassword(){
|
||||||
SetDNSServers(){
|
SetDNSServers(){
|
||||||
|
|
||||||
# Remove setting from file (create backup setupVars.conf.bak)
|
# Remove setting from file (create backup setupVars.conf.bak)
|
||||||
sed -i.bak '/PIHOLE_DNS_1/d;/PIHOLE_DNS_2/d;' /etc/pihole/setupVars.conf
|
sed -i.bak '/PIHOLE_DNS_1/d;/PIHOLE_DNS_2/d;/DNS_FQDN_REQUIRED/d;' /etc/pihole/setupVars.conf
|
||||||
# Save setting to file
|
# Save setting to file
|
||||||
echo "PIHOLE_DNS_1=${args[2]}" >> /etc/pihole/setupVars.conf
|
echo "PIHOLE_DNS_1=${args[2]}" >> /etc/pihole/setupVars.conf
|
||||||
echo "PIHOLE_DNS_2=${args[3]}" >> /etc/pihole/setupVars.conf
|
echo "PIHOLE_DNS_2=${args[3]}" >> /etc/pihole/setupVars.conf
|
||||||
|
@ -82,6 +82,18 @@ SetDNSServers(){
|
||||||
echo "server=${args[2]}" >> /etc/dnsmasq.d/01-pihole.conf
|
echo "server=${args[2]}" >> /etc/dnsmasq.d/01-pihole.conf
|
||||||
echo "server=${args[3]}" >> /etc/dnsmasq.d/01-pihole.conf
|
echo "server=${args[3]}" >> /etc/dnsmasq.d/01-pihole.conf
|
||||||
|
|
||||||
|
# Remove domain-needed entry
|
||||||
|
sed -i '/domain-needed/d;' /etc/dnsmasq.d/01-pihole.conf
|
||||||
|
|
||||||
|
# Readd it if required
|
||||||
|
if [[ "${args[4]}" == "domain-needed" ]]; then
|
||||||
|
echo "domain-needed" >> /etc/dnsmasq.d/01-pihole.conf
|
||||||
|
echo "DNS_FQDN_REQUIRED=true" >> /etc/pihole/setupVars.conf
|
||||||
|
else
|
||||||
|
echo "DNS_FQDN_REQUIRED=false" >> /etc/pihole/setupVars.conf
|
||||||
|
fi
|
||||||
|
# Leave it deleted if not wanted
|
||||||
|
|
||||||
# Restart dnsmasq to load new configuration
|
# Restart dnsmasq to load new configuration
|
||||||
RestartDNS
|
RestartDNS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue