Secure your home network with Pi-hole

November 26, 20223 min read451 words

Introduction

In this article, we will discuss how to secure your home network with Pi-hole. We will cover the following topics:

Prerequisites

  • A server running Ubuntu 20.04 or later

  • Docker installed

Setting up Pi-hole

Installation

To install Pi-hole, run the following command:


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

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

Buy Me a Coffee at ko-fi.com

Website created by Yassine Fathi © 2023

Built with Next.js & Hosted in my Homelab