Changing pi-hole ip-address without running reconfigure (pihole -r) in raspi os buster

which text files i have to edit therefore? is it only these two files?

where in the webinterface the actual ip of the pi-hole is displayed?


This information was removed from the web interface, as it was unreliable. It was only sourced from setupVars.conf and needed a manual change via pihole -r to be set.
Pi-hole now determines the appropriate interface IP automatically. No need to set it manually anymore.

huh - why not simply use 'ip address show' for the interface display???

'Pi-hole now determines the appropriate interface IP automatically.' aha - and what would be an 'appropriate' ip and where it should be set now? and where does 'pihole -r' set the ip of the raspberry now?

FTL will determine the current IP bound to the interface the query arrived on. (This does not mean your device doesn't need a static IP!)

It does this only in cases dhcpcd5 is already installed (i.e on Rapsberry Pi OS). For all other distributions you need to set a static IP manually.

Pi-hole is not meant to be a network monitoring tool. But Pull requests adding this (back) are always welcome.

1 Like

thank you for all the detailed feedback!


found another place where ip-address/network has to be edited when cloning a pi-hole install for another network: /etc/dnsmasq.d/01-pihole.conf

omg - why all this absurd redundant stuff? why not just set the network-properties in one single file/place? is this really so hard dear pi-hole coders?

Why didn't you simply run pihole -r and select the reconfigure option? That's what that option is designed to do.

because this is a very bad method to prepare several clones in one network for differnt other networks so that a clueless employee just has to plug in the pi there and it is immediately accessible remotely via ssh. and because redundant settings are the most pointless thing anyway.

Where do you make out redundant settings?

You're talking about the method you chose to employ.

If you are intent on cloning, I'd suggest a different approach.
Note that for different hardware, the pihole-FTL binary may not match, preventing it from running at all, so that would rule out cloning.
But you could clone the sd card to use it on identical hardware.

Whether that would be "immediately accessible remotely via ssh" would depend on your chosen network configuration on that device.

Of course, if you'd opted for Pi-hole to create a static IP address on-device during installaton or you've configured such a static on-device IP yourself, you're stuck if the new network doesn't match the current one, or if that IP address would've already been taken in the new network.

If you chose to define a fixed IP address for Pi-hole by configuring a DHCP lease reservation in your router instead, you'd just have to find your Pi-hole host machine's IP in your router, ssh into it, and then run pihole -r once.

You could even skip pihole -r if the new network would be identical to your current (that's including the DHCP lease reservation for your Pi-hole host machine, of course).

As an example, I made a pre-built Pi Zero W Pi-hole for my sister who lives 1,600 miles away. I had her change the IP range on her router to match mine, then I made her Pi-hole match the IP I use. This made it a simple clone. I put in her WiFi credentials in the wpa_supplicant file and shipped it.

All she had to do was plug it in and set the DNS on her router DHCP to that IP. It's been running this way for more than 2 years now.

@Bucking_Horn @jfb

yep - we do that similar - even with complete routers for our freelancers. and i did same things private with adsb-receivers. anyways - it is simply a very bad idea to have the ip settings for an pi-hole raspberry redundant in 3 different files/places. and that the webinterface of a network device does not show the actual ip used is cringe too.

Pull requests are welcomed at our GitHub repository.

The reason is simple: the settings in those file do different things.


you define the network settings for the device hosting Pi-hole. This file is completely independent of Pi-hole, but a good point to make sure Pi-hole as a fixed IP assignment (other users might to choose a fixed DHCP assignment).

Is a collection of setting for the web interface and the connection between the web interface and the DNS resolver. We are working already on removing the IP settings from this file, firsts steps are the linked PRs above. If you have a good idea how to solve the open questions in this PR, we are happy to hear about them.

Is the actual configuration file for Pi-hole's embedded DNS server. There are only two typed of IPs set here: Pi-hole's upstream DNS server and (if applicable) the IPs for conditional forwarding.

You have a very specific use case which is not the covered by Pi-hole by default. But remember: Pi-hole is a free time project of volunteers which cost you nothing and does provide a simple way to configure your device in a new environment (pihole -r) which you don't want to use. So please refrain from ranting here.

it is not a rant but the same answer to the same/similar questions. but i give up. it is without question a brilliant idea to manage the ip-addresses in several files. have a nice weekend.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.