Run pihole using pihole in docker https://github.com/pi-hole/docker-pi-hole
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
README.md
lists
pihole

README.md

run-pihole

Run pihole in a docker container

See this: https://github.com/pi-hole/docker-pi-hole

Clone this repo and run ./pihole as explained below:

Works on Linux and on MacOS.

In its simplest form, just run:

./pihole

The script attempts to glean the existing DNS configuration and to configure the container to use those servers as its upstream resolvers.

If that won't work, just pass the explicit servers as arguments on the command line.

For examplem to set up pihole to hit Cloudflare's servers, do this:

./pihole 1.1.1.1

PiHole configuration (additional block lists, etc.)

The ./lists script here sets up the pihole configuration as explained in this blog post: https://hobo.house/2018/02/27/block-advertising-with-pi-hole-and-raspberry-pi/

The pihole shell script waits for the container to be operational and then it runs the configuration script. Configuration data persists in the ./config/ directory.

By default, this script is set up to use the Quad9 DNS servers.

Once the pihole container is up, set up your laptop's DNS to use 127.0.0.1 as its DNS.

Set up MacOS DNS settings via commandline

From http://osxdaily.com/2015/06/02/change-dns-command-line-mac-os-x/

To set up the DNS on MacOS, you can do:

networksetup -setdnsservers Wi-Fi 127.0.0.1

To reset it (when you are no longer using it):

networksetup -setdnsservers Wi-Fi Empty

If you are using a different network adapter, you may have to replace the Wi-Fi above with whatever the appropriate service name is, gleaned by running networksetup -listallnetworkservices

Stopping pihole, upgrading, etc.

To stop the container, you can use docker stop pihole

To restart the container, docker start pihole

To destroy it entirely, docker rm -f pihole

Upgrade by doing a docker pull:

docker rm -f pihole
docker pull pihole/pihole
./pihole