I’m Yassine Fathi, a software engineer based in Morocco. I specialize in web and mobile development, both backend and frontend, with a focus on simplicity, usability & performance.
I love building things. While hard engineering problems are often intrinsically fun to tackle, I'm most attracted to solving real customer problems with a business justification.
November 28, 2022 • 3 min read • 438 words
## [Introduction](#introduction) In this article, we will discuss how to secure your home network with Pi-hole. We will cover the following topics: - [Introduction](#introduction) - [Prerequisites](#prerequisites) - [Setting up Pi-hole](#setting-up-pi-hole) - [Conclusion](#conclusion) ## [Prerequisites](#prerequisites) - A server running Ubuntu 20.04 or later - Docker installed ## [Setting up Pi-hole](#setting-up-pi-hole) ### Installation To install Pi-hole, run the following command: ```bash docker run -d \ --name=pihole \ --restart=always \ -p 53:53/tcp \ -p 53:53/udp \ -p 80:80 \ -p 443:443 \ -v /path/to/pihole:/etc/pihole \ -v /path/to/dnsmasq.d:/etc/dnsmasq.d \ -e TZ=America/New_York \ -e WEBPASSWORD=your-password \ pihole/pihole:latest ``` ### Configuration To configure Pi-hole, open your browser and go to `http://your-ip/admin`. You will be prompted to enter the password you set in the `docker run` command. Once you have entered the password, you will be able to access the Pi-hole dashboard. ### Changing DNS settings on your devices To change the DNS settings on your devices, go to your router's settings and change the DNS settings to the IP address of your Pi-hole server. #### Windows To change the DNS settings on Windows, go to `Control Panel > Network and Internet > Network and Sharing Center > Change adapter settings`. Right-click on your network adapter and select `Properties`. Select `Internet Protocol Version 4 (TCP/IPv4)` and click `Properties`. Select `Use the following DNS server addresses` and enter the IP address of your Pi-hole server in the `Preferred DNS server` and `Alternate DNS server` fields. #### macOS To change the DNS settings on macOS, go to `System Preferences > Network > Advanced > DNS`. Click the `+` button and enter the IP address of your Pi-hole server in the `Server` field. #### Linux To change the DNS settings on Linux, go to `System Settings > Network > Network Connections`. Right-click on your network adapter and select `Edit Connections`. Select `IPv4 Settings` and click `Add`. Enter the IP address of your Pi-hole server in the `DNS` field. #### Android To change the DNS settings on Android, go to `Settings > Network & Internet > Wi-Fi`. Select your Wi-Fi network and click `Modify network`. Select `Show advanced options` and enter the IP address of your Pi-hole server in the `DNS 1` and `DNS 2` fields. #### iOS To change the DNS settings on iOS, go to `Settings > Wi-Fi`. Select your Wi-Fi network and click `Configure DNS`. Select `Manual` and enter the IP address of your Pi-hole server in the `Primary DNS` and `Secondary DNS` fields. ## [Conclusion](#conclusion) In this article, we discussed how to secure your home network with Pi-hole. We installed Pi-hole and configured it to block ads and malware. We also configured Pi-hole to use Cloudflare's DNS servers. ## Further reading - [Pi-hole](https://pi-hole.net/) - [Pi-hole on Docker Hub](https://hub.docker.com/r/pihole/pihole)
November 26, 2022 • 3 min read • 451 words
Website created by Yassine Fathi © 2022
Built with Next.js & Hosted in my Homelab