Skip to content

Commit

Permalink
Merge pull request pi-hole#1291 from pi-hole/fix/defaultlisteningbeha…
Browse files Browse the repository at this point in the history
…vior

Fix default listening behavior of dnsmasq
  • Loading branch information
DL6ER authored Mar 3, 2017
2 parents 6f1ed28 + f626406 commit 051f463
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 2 additions & 0 deletions advanced/01-pihole.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ no-resolv
server=@DNS1@
server=@DNS2@

interface=@INT@

cache-size=10000

log-queries
Expand Down
18 changes: 8 additions & 10 deletions advanced/Scripts/webpage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,13 @@ trust-anchor=.,19036,8,2,49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE3

if [[ "${DNSMASQ_LISTENING}" == "all" ]]; then
# Listen on all interfaces, permit all origins
# Leave a comment in 01-pihole.conf
add_dnsmasq_setting "# Listening on all interfaces"
add_dnsmasq_setting "except-interface" "nonexisting"
elif [[ "${DNSMASQ_LISTENING}" == "single" ]]; then
# Listen only on one interface
add_dnsmasq_setting "interface" "${PIHOLE_INTERFACE}"
else
elif [[ "${DNSMASQ_LISTENING}" == "local" ]]; then
# Listen only on all interfaces, but only local subnets
add_dnsmasq_setting "local-service"
else
# Listen only on one interface
add_dnsmasq_setting "interface" "${PIHOLE_INTERFACE}"
fi

}
Expand Down Expand Up @@ -394,12 +392,12 @@ SetListeningMode(){
if [[ "${args[2]}" == "all" ]] ; then
echo "Listening on all interfaces, permiting all origins, hope you have a firewall!"
change_setting "DNSMASQ_LISTENING" "all"
elif [[ "${args[2]}" == "single" ]] ; then
echo "Listening only on interface ${PIHOLE_INTERFACE}"
change_setting "DNSMASQ_LISTENING" "single"
else
elif [[ "${args[2]}" == "local" ]] ; then
echo "Listening on all interfaces, permitting only origins that are at most one hop away (local devices)"
change_setting "DNSMASQ_LISTENING" "local"
else
echo "Listening only on interface ${PIHOLE_INTERFACE}"
change_setting "DNSMASQ_LISTENING" "single"
fi

# Don't restart DNS server yet because other settings
Expand Down
1 change: 1 addition & 0 deletions automated install/basic-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ version_check_dnsmasq() {
echo -n "::: Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf..."
cp ${dnsmasq_pihole_01_snippet} ${dnsmasq_pihole_01_location}
echo " done."
sed -i "s/@INT@/$PIHOLE_INTERFACE/" ${dnsmasq_pihole_01_location}
if [[ "${PIHOLE_DNS_1}" != "" ]]; then
sed -i "s/@DNS1@/$PIHOLE_DNS_1/" ${dnsmasq_pihole_01_location}
else
Expand Down

0 comments on commit 051f463

Please sign in to comment.