Pi-hole is a Linux based web application, which is used as a shield from the unwanted advertisement in your network and also block the internet tracking system. This is very simple to use and best for home and small office networks. This is totally free and open-source. It also allows you to manage your accessibility and blocklist as well. It has a very decent graphical way of showing the network queries. Docker is a tool that works on containerization technology. This is used to launch containers for different requirements like a webserver, a DNS and many more. To know more about docker you check it out here on GeeksForGeeks and for launching your own web server on docker you could see it here.
How to setup pi-hole and Docker?
Open your terminal and Start docker
sudo systemctl start docker
Enter the command to download pinhole from docker hub
sudo docker pull pihole/pihole
Step 2: Skip this if you are not using Ubuntu
sudo systemctl stop systemd-resolved.service
sudo systemctl disable systemd-resolved.service
Change the DNS to something else like google
sudo nano /etc/resolve.conf
set DNS 220.127.116.11 and save.
Copy this code
TZ: 'Asia/Kolkata' #this is the time zone
Open a File
sudo nano docker-compose.yml
copy paste the above code here and save the file.
Run the compose file to launch pihole
sudo docker-compose up -d
Move inside pihole container
sudo docker exec -it pihole bash
Change pihole password
pihole -a -p
Go to browser and search
Use IP and copy-paste the IP to browser
Ip in browser pihole
Login with the password
That’s it all set.
Now use the pihole as your DNS instead of any other.
Go to dns setting in your windows…
settings –> Network and Internet –> Ethernet (if you are connected to ethernet) or WiFi ( if your laptop connected to wifi) –> change adapter options –>right click on wifi or ethernet and go to properties –> select ipv4 –> properties –> change the DNS to the IP of pihole.
Change the DNS from obtain DNS automatically to Use following dns server and write the ip the box. In second you could write any dns like 18.104.22.168
Same Pi-hole IP can be used in the home router as DNS.
Unlock the Power of Placement Preparation!
Feeling lost in OS, DBMS, CN, SQL, and DSA chaos? Our Complete Interview Preparation
Course is the ultimate guide to conquer placements. Trusted by over 100,000+ geeks, this course is your roadmap to interview triumph.
Ready to dive in? Explore our Free Demo Content and join our Complete Interview Preparation