1
0
mirror of https://github.com/moparisthebest/pi-hole synced 2024-11-25 18:42:16 -05:00

Merge pull request #3 from jacobsalmela/master

Upstream sync
This commit is contained in:
Dan Schaper 2015-12-05 23:04:08 -08:00
commit 3e0daa7e3c
3 changed files with 13 additions and 9 deletions

View File

@ -1,4 +1,6 @@
# Automated Install # Automated Install
#### Designed For Raspberry Pi B, B+, 2,
##### and Zero (with an Ethernet adapter)
1. Install Raspbian 1. Install Raspbian
2. Run the command below 2. Run the command below
@ -11,12 +13,10 @@ Once installed, **configure any device to use the Raspberry Pi as its DNS server
[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif "AdminLTE Presentation")](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3J2L3Z4DHW9UY "Donate") [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif "AdminLTE Presentation")](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3J2L3Z4DHW9UY "Donate")
# Raspberry Pi Ad Blocker # How Does It Work?
**A black hole for ads, hence Pi-hole** **Watch the 60-second video below to get a quick overview**
![Pi-hole](http://i.imgur.com/wd5ltCU.png) [![Pi-hole exlplained](http://i.imgur.com/wd5ltCU.png)](https://vimeo.com/135965232)
The Pi-hole is a DNS/Web server that will **block ads for any device on your network**.
## Coverage ## Coverage

View File

@ -18,7 +18,7 @@ bogus-priv
# uncomment this. # uncomment this.
no-resolv no-resolv
# Add other name servers here, with domain specs if they are for # Add other name servers here, with domain specs if they are for
# non-public domains. # non-public domains.
server=8.8.8.8 server=8.8.8.8
server=8.8.4.4 server=8.8.4.4
@ -26,7 +26,7 @@ server=8.8.4.4
# If you want dnsmasq to listen for DHCP and DNS requests only on # If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the # specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here. # interface (eg eth0) here.
interface=eth0 interface=@INT@
# Or which to listen on by address (remember to include 127.0.0.1 if # Or which to listen on by address (remember to include 127.0.0.1 if
# you use this.) # you use this.)
listen-address=127.0.0.1 listen-address=127.0.0.1
@ -45,3 +45,6 @@ log-facility=/var/log/pihole.log
# server for potentially stale date, you can set a time-to-live (in # server for potentially stale date, you can set a time-to-live (in
# seconds) here. # seconds) here.
local-ttl=300 local-ttl=300
# This allows it to continue functioning without being blocked by syslog, and allows syslog to use dnsmasq for DNS queries without risking deadlock
log-async

View File

@ -92,7 +92,6 @@ cmd=(whiptail --separate-output --checklist "Select Protocols" $r $c 2)
options=(IPv4 "Block ads over IPv4" on options=(IPv4 "Block ads over IPv4" on
IPv6 "Block ads over IPv4" off) IPv6 "Block ads over IPv4" off)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty) choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear
for choice in $choices for choice in $choices
do do
case $choice in case $choice in
@ -179,6 +178,7 @@ echo "interface $piholeInterface
static ip_address=$IPv4addr static ip_address=$IPv4addr
static routers=$IPv4gw static routers=$IPv4gw
static domain_name_servers=$IPv4gw" | sudo tee -a $dhcpcdFile >/dev/null static domain_name_servers=$IPv4gw" | sudo tee -a $dhcpcdFile >/dev/null
echo "Setting IP to $IPv4addr. You may need to restart after the install is complete."
sudo ip addr replace dev $piholeInterface $IPv4addr sudo ip addr replace dev $piholeInterface $IPv4addr
} }
@ -200,6 +200,7 @@ sudo mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.orig
sudo mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.orig sudo mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.orig
sudo mv /etc/crontab /etc/crontab.orig sudo mv /etc/crontab /etc/crontab.orig
sudo curl -o /etc/dnsmasq.conf https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/dnsmasq.conf sudo curl -o /etc/dnsmasq.conf https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/dnsmasq.conf
sudo sed -i "s/@INT@/$piholeInterface/" /etc/dnsmasq.conf
sudo curl -o /etc/lighttpd/lighttpd.conf https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/lighttpd.conf sudo curl -o /etc/lighttpd/lighttpd.conf https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/lighttpd.conf
sudo mv /etc/crontab /etc/crontab.orig sudo mv /etc/crontab /etc/crontab.orig
sudo curl -o /etc/crontab https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/pihole.cron sudo curl -o /etc/crontab https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/pihole.cron