Technical Anshu
Tutorials Blog
🕳️ Pi-hole Setup

Install Pi-hole on Ubuntu Complete Setup Guide

One Ubuntu machine can quietly remove ads and trackers for every phone, TV and laptop in your house. Pi-hole does it at the DNS level, before the ad is even downloaded. Here is the complete setup, done in the right order, with the honest limits stated plainly.

✍️ Technical Anshu🐧 Ubuntu / Pi-hole⏱️ 30 minute setup
🎥 🎥 Watch the full video: Ubuntu par Pi-hole install karne ka complete process, live step-by-step

Every device in your home asks one question many times a minute: what is the address of this website? That question goes to a DNS server. Pi-hole becomes that server for your whole network, and when the question is about a known ad or tracking domain, it answers with a blank — so the ad never loads. This guide installs it on Ubuntu, gives it a permanent address, connects your router to it, and tells you honestly what it can and cannot do. Follow the order: address first, install second, router last.

Terminal — Ubuntu (after install)
$ pihole status [✓] Pi-hole blocking is enabled $ nslookup doubleclick.net 192.168.1.10 Server: 192.168.1.10 Address: 192.168.1.10#53 Name: doubleclick.net Address: 0.0.0.0
👆 The finish line: a known ad domain answered with 0.0.0.0 means Pi-hole blocked it (panel recreated with real command wording; 192.168.1.10 is an example address)
1

Give the Ubuntu Machine a Fixed Address First

Pi-hole must live at an address that never changes, because every device in the house will be told to ask it for DNS. If its address moves, the whole house loses name resolution. Set a static IP on the Ubuntu machine (or reserve its address in the router) before you install anything, and keep that address outside the range your router hands out automatically. The full reasoning and both methods are covered in the static IP case guide in this series.

2

Update Ubuntu, Then Run the Official Installer

Pi-hole is installed with the project's own automated installer, straight from pi-hole.net. First update the system packages:

  1. sudo apt update
  2. Then run the installer exactly as published on pi-hole.net: curl -sSL https://install.pi-hole.net | bash

The installer checks your system, installs what Pi-hole needs, and then walks you through a few blue setup screens. Take them slowly — the next steps happen inside those screens.

3

Choose an Upstream DNS Provider

Pi-hole blocks the bad questions, but the good ones still need a real answer. In the installer you pick an upstream DNS provider — names like Cloudflare, Google, Quad9 or OpenDNS are offered in the list. Any of them works; the practical difference is speed and the provider's own logging policy. Pi-hole asks them only for domains that are not on your blocklists, and caches the answers, so repeat questions are answered locally and instantly.

4

Keep the Default Blocklist Tick and Finish

The installer offers a starting blocklist (the well-known Steven Black list). Leave it ticked — it is a sane, conservative starting point that blocks ads and trackers without breaking normal sites. Confirm the static IP details when asked, let the installation complete, and note the admin password shown at the end. That password protects the web dashboard; if you ever lose it, it can be reset from the terminal on the Ubuntu machine itself.

5

Now Point Your Router at Pi-hole

Installing Pi-hole changes nothing until devices actually use it. Log in to your router's settings, find the DHCP or LAN DNS setting, and set the DNS server to the Pi-hole machine's static address. From then on, every device that joins your network is automatically told to resolve names through Pi-hole. Renew a device's connection (or reboot it) and it picks up the new DNS. Setting the DNS on each device by hand also works and is covered in this series, but the router change is the one-time fix for the whole home.

6

Verify From a Client, Not From the Server

Open a browser on a phone or laptop and load a few normal sites, then open the Pi-hole dashboard at http://pi.hole/admin (or the machine's address followed by /admin) from that device. You should see queries arriving live on the dashboard. That — not a successful install screen — is the proof the setup works: real devices, asking real questions, with the blocked ones quietly disappearing.

🟠 The honest limit, before you expect magic: Pi-hole blocks at the DNS level only. Ads that are served from the same domain as the content itself — YouTube in-stream ads are the famous example — cannot be blocked this way, because blocking that domain would block the videos too. Pi-hole removes a huge amount of junk across the whole network, but it is not a YouTube ad blocker.

🎥 Watch the Full Pi-hole Installation Video

Ubuntu par Pi-hole install karne ka pura process — installer screens se lekar router setting tak, live step-by-step is video me dikhaya gaya hai.

▶️ Watch Full Video
❓ Common Questions (FAQ)

Does Pi-hole work on any Ubuntu version?

Pi-hole's automated installer supports current Ubuntu LTS releases, and the installer itself checks your system and tells you if something is unsupported. It also runs happily on very modest hardware — an old laptop or mini PC that can stay on all day is ideal, because the Pi-hole machine must be awake whenever the house is online.

Can Pi-hole block YouTube ads?

No — and any guide promising that is not being straight with you. YouTube serves its ads from the same domains as its videos, so a DNS blocker cannot separate them. Blocking those domains would break YouTube itself. Pi-hole is excellent at network-wide ad and tracker domains everywhere else, but in-app and in-stream ads served from the content domain are outside what DNS blocking can do.

What happens to my internet if the Pi-hole machine is switched off?

Devices that use Pi-hole as their only DNS server will fail to open websites by name until it comes back, because nobody is answering their questions. That is why this guide insists on a machine that stays on, and why the redundancy case guide in this series covers second-DNS and backup options honestly.

This guide is based on the Pi-hole on Ubuntu video by Technical Anshu • Stuck on a step? Ask in the video comments — that is where answers come fastest 🙏