Pi-hole is a network-level ad blocker that acts as a DNS layer and possibly a DHCP3 server for use on a private network. It is designed to be installed on embedded devices with network capabilities, such as the Raspberry Pi, but can be used on other machines running GNU/Linux or in virtualised environments.
Warning, you should be aware that touching your DHCP could break your network. In case your server is inaccessible, you will lose your dns resolution and IP address. Thus, you would lose any connection to the internet and even the connection to your router.
If you encounter this kind of problem, please read the section "How to restore my network".
There are 2 ways to configure Pi-hole to be used as your DHCP server.
Your router or your ISP's router has a DHCP server enabled by default. If you keep this DHCP, along with Pi-hole's, you will have transparent conflicts between them. The first DHCP server to respond will distribute its own IP and settings. So you need to turn off your router's DHCP server and let Pi-hole manage your network.
By using Pi-hole's DHCP, you allow Pi-hole to give its dns configuration to each of your clients. This way, every request will be filtered by Pi-hole.
Another case of using Pi-hole DHCP is if you have hairpinning problems (you can't connect to your server because its IP is your public IP, and your router doesn't allow this). In this case, using Pi-hole's dns will allow you to connect to your server by its local address rather than its public address.
Oops! Your Pi-hole server has crashed, and you don't have DHCP anymore. Don't panic. We'll get through this.
Use your favorite device on your desktop computer.
And first, get your network interface (usually
Then change your IP to a static one.
sudo ifconfig eth0 192.168.1.100
Now you can connect to your router and reboot its DHCP server to use it again. You can now remove your static IP and get a dynamic IP again.
sudo ifconfig eth0 0.0.0 && sudo dhclient eth0
Remember to turn off your router's DHCP if your server is running again.
Found errors? Think you can improve this documentation? Simply click the Edit link at the top of the page, and then the icon on Github to suggest changes.