Setting Up Pi-hole on Ubuntu for a Cleaner Home Network

Pi-hole turns an Ubuntu computer into a network-wide DNS filter. Instead of asking an advertising or tracking domain for its address, devices on your home network ask Pi-hole first. If the domain appears on a blocklist, Pi-hole returns no usable address, preventing many adverts, analytics requests, and nuisance connections before they reach phones, laptops, smart televisions, or game consoles.

The arrangement works at the DNS level, so it does not require a browser extension on every device. It can cover an Ubuntu desktop, Android handset, iPad, streaming box, and Internet of Things equipment from one place. DNS filtering cannot remove every advert, particularly adverts delivered from the same domain as a video or web page, but it is a useful first layer.

An always-on Ubuntu machine is ideal for a small household server. An old mini PC, a low-power desktop, or a virtual machine can all work. A Raspberry Pi is also popular, although the software does not require Raspberry Pi hardware. For an Australian home using an NBN connection, Pi-hole sits inside the house and works independently of whether the service comes from Telstra, TPG, iiNet, Aussie Broadband, or another provider.

Choose The Ubuntu Host And Prepare The Network

Use Ubuntu Server if you have a spare computer, as it avoids running a full graphical desktop. Ubuntu Desktop is perfectly suitable too, provided it remains switched on and connected to the network. A wired Ethernet connection is preferable for reliability, especially if the machine will provide DNS to smart televisions and other devices that may behave unpredictably when Wi-Fi briefly drops.

Give the Ubuntu host a dependable local address before changing DNS settings. The simplest approach is a DHCP reservation in your router. Open the router’s administration page, find the Ubuntu computer in the connected-device list, and reserve its current address. For example, you might reserve 192.168.1.20. The exact menus vary widely between a Telstra Smart Modem, an eero system, and a router supplied by an independent NBN provider.

On Ubuntu, identify the current address and update the operating system:

hostname -I
sudo apt update
sudo apt full-upgrade -y
sudo apt install curl dnsutils -y

The address should remain the same after a reboot. If the router cannot create reservations, configure a static address with Netplan, but make sure it is outside the router’s automatic DHCP pool. Two devices using the same address will cause intermittent DNS failures that can look like a Pi-hole problem.

Keep the host on the local network while installing it. Pi-hole needs access to upstream DNS services during setup, but it does not need any inbound access from the public Internet. Do not forward DNS port 53 or the Pi-hole web interface to the Internet. If your NBN connection uses carrier-grade NAT, remote access may already be restricted, but that is not a security strategy to rely on.

Install Pi-hole And Complete The Initial Configuration

The official installer is the quickest method on Ubuntu. Download and run it from a terminal on the Ubuntu machine:

curl -sSL https://install.pi-hole.net | bash

The installer displays a sequence of screens. Select the network interface that reaches your router, confirm the machine’s address, choose one or more upstream DNS providers, and enable the default blocklists. Cloudflare and Quad9 are common choices for Australian households, while your ISP’s resolver may sometimes provide the lowest latency. You can change this choice later from the web interface.

The installer also enables the Pi-hole web dashboard. Once setup finishes, open this address from another device:

http://192.168.1.20/admin

Replace the example address with the reserved address of your Ubuntu host. The installer normally shows an administrative password near the end. On current Pi-hole releases, you can set or change it with:

sudo pihole setpassword

The dashboard shows total DNS queries, blocked requests, frequently requested domains, and clients that are using the service. These figures are useful for diagnosing the network, although they also represent a record of household DNS activity. Keep the dashboard available only on the local network and use a strong password.

If installation reports that port 53 is already in use, check which process owns it:

sudo ss -lntup | grep ':53'

Ubuntu’s systemd-resolved service commonly listens on a local stub address. Pi-hole can often coexist with it, but a custom DNS service, container, or previous resolver installation may conflict. Do not stop services at random; identify the process first, then follow the relevant Pi-hole or Ubuntu documentation for that configuration.

Point Your Home Network At The DNS Filter

The most convenient setup is to change DNS in the router’s LAN or DHCP settings. Set the primary DNS server to the Ubuntu host, such as 192.168.1.20. You can leave a secondary DNS field empty if the router permits it. Adding Google or ISP DNS as a fallback may allow some devices to bypass Pi-hole when the first resolver is unavailable, reducing filtering consistency.

After saving the router configuration, reconnect a phone or computer, or renew its DHCP lease. On Ubuntu, inspect the active DNS settings with:

resolvectl status

Test Pi-hole directly before troubleshooting a client:

dig example.com @192.168.1.20
dig doubleclick.net @192.168.1.20

The first command should return a normal address. The second may return 0.0.0.0, ::, or no useful answer, depending on the blocklist and Pi-hole configuration. The dashboard should also show the queries arriving from your devices.

Some ISP-provided routers hide or lock the LAN DNS controls. In that case, configure DNS individually on computers and mobile devices, replace the router with a model that supports custom DHCP options, or place the ISP unit into bridge or modem mode where supported. Each choice has trade-offs. A device-by-device setup is easy to test but tedious for visitors and smart appliances.

IPv6 deserves special attention. A router may advertise the ISP’s IPv6 DNS server even after IPv4 DNS points to Pi-hole, allowing some devices to bypass the filter. Either configure Pi-hole with a stable IPv6 address and advertise it through the router, or adjust the router’s IPv6 DNS settings. Testing with both dig and the Pi-hole dashboard is more reliable than assuming IPv6 is disabled.

Tune Blocklists Without Breaking Everyday Services

Pi-hole includes a default blocklist that covers many advertising and tracking domains. Begin with that list rather than importing dozens of community lists. Excessive lists can block login services, shopping tools, payment pages, software updates, or images used by legitimate websites. A smaller, well-maintained collection usually produces fewer false positives and less maintenance.

Use the Query Log in the dashboard when a site stops working. Search for blocked domains related to the page or application, then allow only the domain required for that function. The Allowlist is preferable to disabling Pi-hole for the whole network. If ABC iview, 7plus, 9Now, a banking website, or a streaming service behaves oddly, check the log before assuming the service itself is offline.

DNS filtering has clear limits. It cannot reliably remove adverts embedded in the same domain as content, and it cannot inspect encrypted page traffic. You may still see sponsored posts in social media, adverts in some YouTube content, or promotions built directly into an application. Browser privacy settings, content blockers, and sensible device permissions remain useful alongside Pi-hole.

Different household devices can also need different policies. Pi-hole supports groups, allowing a stricter profile for laptops and phones while leaving a smart television or work device on a more permissive list. This is helpful when a child’s tablet needs extra blocking, or when an employer’s remote-work software fails because a tracking or authentication domain was filtered.

Maintain The Server And Diagnose Common Problems

When the Internet appears to stop working, first check whether the Ubuntu host is powered on and whether its reserved address has changed. Test an external address and a domain separately:

ping -c 3 1.1.1.1
dig example.com @192.168.1.20

If the IP ping works but the DNS query fails, inspect Pi-hole’s status:

sudo systemctl status pihole-FTL
sudo pihole status

A single client may retain old DNS information for several minutes. Restarting its network connection or rebooting it can force a fresh DHCP configuration. If only one website fails, review the Query Log and temporarily allow the relevant domain rather than turning off network-wide filtering.

Keep Ubuntu and Pi-hole updated:

sudo apt update
sudo apt upgrade -y
pihole -up

Run updates during a quiet period, such as an evening rather than just before a video call or a busy Saturday morning. Pi-hole briefly restarting during an update is normally harmless, but every device will lose name resolution if the server is the only DNS resolver and it is unavailable.

Pi-hole stores useful configuration and query data, so protect it like any other home server. Use the dashboard’s backup or Teleporter feature to export settings, and store the file somewhere other than the Ubuntu host. Consider limiting query retention if detailed history is unnecessary. A VPN such as WireGuard is a safer way to reach the dashboard while away from home; exposing the admin page or DNS service through router port forwarding is unsafe.

The result is a local DNS service that can reduce tracking requests across an Australian household without changing every browser. It also gives you a clear view of which devices make the most requests and which domains cause problems. Begin by reserving an address such as 192.168.1.20 for the Ubuntu host, install Pi-hole, and change the router’s LAN DNS setting to that address.