Pi-hole Configuration
HEAD'S UP
If you haven't read the primer on name server configuration, you should read that first as this page builds on the information presented there.
What is Pi-hole?
Pi-hole is a network-wide ad blocker which returns invalid responses for known ad/tracker DNS requests. It also provides a DHCP server and custom DNS record resolution.
Fields
host string required
The host field is the URL at which to connect to your Pi-hole instance's web interface.
Example:
[name_servers.pihole_server]
service = "pihole"
host = "http://192.168.1.60"
api_key = "<api key>"DOCKNS_NS_PIHOLE_SERVER_SERVICE=pihole
DOCKNS_NS_PIHOLE_SERVER_HOST=http://192.168.1.60
DOCKNS_NS_PIHOLE_SERVER_API_KEY=<api key>You can also include a port if your web interface is hosted on a port other than 80 (http://192.168.1.60:8053).
api_key string required
Pi-hole's authentication system allows for only two passwords to login, the user-generated one, and an app password. The app password is only required if 2 Factor Authentication is enabled, otherwise, either the user password or the app password can used as the api_key.
To obtain the app password, login to your Pi-hole instance and go to "Settings > Web interface/API". You will need to make sure the switch in the top right corner is set to Expert mode (not Basic). Once Expert mode is enabled, the "Advanced Settings" section will have a "Configure app password" button. Clicking that button will open a pop-up with a randomly generated app password, which you should copy into the api_key field (or set the DOCKNS_NS_<SERVER ID>_API_KEY environment variable). Once you have saved the app password, click "Enable new app password".