Technical Anshu
Tutorials Blog
🌐 Network Basics

Pi-hole Static IP Setup on Ubuntu Why the Address Must Never Change

Pi-hole is an address your entire house depends on. If that address ever changes, every device is left asking an empty room for directions. This guide explains why the static IP is non-negotiable and shows both honest ways to set one.

✍️ Technical Anshu🐧 Ubuntu / Pi-hole⏱️ 10 minute read
🎥 🎥 Pehle video me pura install dekho — static IP wala step wahan live dikhaya gaya hai

When you point your router at Pi-hole, you are writing one address into the instructions every device receives: ask 192.168.1.10 for DNS. Routers normally hand out addresses by DHCP, and a DHCP address can change after a reboot or a power cut. If the Ubuntu machine comes back with a different address, your devices keep asking the old one — and websites simply stop opening, everywhere, all at once. A static IP (or a DHCP reservation, which achieves the same thing) makes the address permanent. Here is how to choose it and set it safely.

Terminal — Ubuntu
$ ip addr show 2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> inet 192.168.1.10/24 brd 192.168.1.255 scope global $ ip route | grep default default via 192.168.1.1 dev enp3s0
👆 The two facts you need before choosing an address: the machine's current address and the router (gateway) address (example values)
1

Understand What Actually Breaks

Nothing about Pi-hole itself minds a new address — it would happily serve DNS at any address. The breakage is on the client side: your router has told a hundred devices to use the old address, and they cannot know it moved. Symptoms look like a total internet failure — Wi-Fi connected, nothing opens — which sends most people blaming their internet provider. Fix the address permanently and this entire class of failure disappears.

2

Pick an Address Outside the DHCP Pool

Your router reserves a range of addresses to hand out automatically (the DHCP pool), for example 192.168.1.100 to 192.168.1.200. Choose the Pi-hole address inside your network but outside that pool — for example 192.168.1.10 — so the router can never hand the same address to a phone and create a conflict. Find the pool range in the router's LAN or DHCP settings page and write down your chosen address.

3

Option A — Reserve the Address in the Router

The simplest method, and the one least likely to be misconfigured: in the router's DHCP settings, find address reservation (some routers call it static lease or fixed IP) and bind the Ubuntu machine's MAC address to your chosen IP. The machine still asks DHCP for its address like normal — it simply always gets the same answer. This survives reinstalls of Ubuntu and keeps all address management in one place: the router.

4

Option B — Set a Static IP on Ubuntu Itself

If your router has no reservation feature, set the address in Ubuntu's netplan configuration instead. The machine then claims the address itself rather than asking for one. When you do this, set all three values correctly — address with its /24 prefix, the gateway (your router's address), and a DNS server for the machine's own lookups (the router or an upstream provider; the Pi-hole machine should not depend on itself before it has started). Test connectivity before rebooting, so a typing mistake does not lock you out of a headless box.

5

Then Give Pi-hole Its Own Address — Not localhost Thinking

During installation, Pi-hole asks about the static address and gateway; answer with the values you set. Afterwards, test from another device: query the Pi-hole address directly with nslookup example.com 192.168.1.10 (using your address). An answer means the permanent home is live. Finally, note the address somewhere durable — every future fix in this series starts with 'open the dashboard at the Pi-hole address'.

🟠 One warning that saves a bad evening: if you change the address later — new router, new network range — remember that the router's DNS setting and every manually configured device still point at the old address. An address change is a small project, not a casual tweak: update the router setting in the same sitting.

🎥 Watch the Full Pi-hole Installation Video

Static IP wala step aur installer ke baaki screens — sab kuch live is video me dikhaya gaya hai.

▶️ Watch Full Video
❓ Common Questions (FAQ)

Is a DHCP reservation the same as a static IP?

For Pi-hole's purpose, yes. A true static IP is configured on the Ubuntu machine itself; a reservation is configured on the router and guarantees the machine always receives the same address by DHCP. Both give Pi-hole a permanent address. The reservation is usually simpler and keeps everything managed in one place.

Can I just use the address the router already gave the machine?

Only if you make it permanent with one of the two methods in this guide. An ordinary DHCP address can change after a reboot, a long power cut, or a router reset — and when it does, every device in the house loses DNS at once.

Which address should I choose for Pi-hole?

One inside your network's range but outside the router's DHCP pool — for example, if devices get 192.168.1.100 onwards, 192.168.1.10 is a typical safe choice. Avoid the router's own address (.1) and anything another fixed device (printer, NAS, camera) already uses.

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 🙏