A DNS server must have a fixed IP address — if the IP changes, every device on the network loses DNS resolution. Pi-hole Ubuntu Deploy configures a static IP using Ubuntu’s Netplan network configuration system, ensuring your Pi-hole remains reachable at the same address even after reboots and router restarts.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/damianiglesias/pihole-ubuntu-deploy/llms.txt
Use this file to discover all available pages before exploring further.
How deploy.sh Handles It
deploy.sh automates the entire static IP configuration process interactively during installation.
List available network interfaces
The script enumerates all non-loopback interfaces so you can identify the correct one:
Detect the current gateway
The default gateway is read from the kernel routing table:If no gateway is found,
192.168.1.1 is used as a fallback.Confirm static assignment
The detected IP and interface are displayed and you are prompted to confirm:
Write the new Netplan configuration
A new file
/etc/netplan/99-pihole-static.yaml is created with the detected values and permissions are locked down immediately:Generated Netplan Configuration
deploy.sh writes the following YAML template, substituting your detected interface name, IP address, and gateway at runtime:
Manual Static IP Setup
If you skipped static IP configuration during thedeploy.sh run, you can apply it at any time by following these steps.
Find your current IP address
Replace Look for the
<interface> with your interface name from the previous step:inet line — the address before the / is your IP (e.g., 192.168.1.100).Create the Netplan file
Open a new Netplan configuration file in your editor:Paste and adjust the following, replacing the interface name, IP, and gateway with your own values:
Set correct file permissions
Netplan enforces strict permission requirements on its configuration files:
Verification
After applying the static IP — whether viadeploy.sh or manually — confirm the address is active and the host has network connectivity:
ip command should show your chosen static address, and the ping should complete successfully, confirming that routing and DNS are functioning.