Please follow the below template, it will help us to help you!
Expected Behaviour:
I created a Pi-hole on a Raspberry PI running Raspbian Stretch Lite, and set a static IP of 10.0.10.10, works for about a week. Expectation is that 10.0.10.10 is always going to be the STATIC IP. My PFSense DHCP server provides this address to all DHCP requests.
Actual Behaviour:
After about a week, Raspbian Lite pulls a DHCP address of 10.0.10.104 (in my DHCP scope). The web gui for Pi-hole shows 10.0.10.10 as the IP address and when I SSH into the Raspberry Pi running Raspbian Lite, and run IP ADDR, it shows 10.0.10.104 as the ETH0 IP! Also, /etc/dhcpcd.conf shows the proper information of 10.0.10.10 for the ETH0 interface.
/etc/network/interfaces simply says:
" # interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d: source-directory /etc/network/interfaces.d "
I have run updates and upgrades, as well as pihole -up. I have also done numerous pihole -r attempts with reconfigure but still get the 10.0.10.104 address no matter how many times i tell the wizard I want 10.0.10.10. to be the static IP.
Where did you set this static IP - in the Pi OS or at the router DHCP? If the router has not reserved this IP for the Pi, it may get a new one at lease renewal.
I set the 10.0.10.10 when I run the wizard during the Pi-hole configuration and whenever I do pihole -r reconfigure. It says "do you want to use 10.0.10.104/24" and i say hell no, and I change it to 10.0.10.10/24 and it never sticks!
Take a look at this thread. You need to make the IP address for the Pi static (or reserved) in your router, so the router will never give it a different address.
The warning in the setup process that your Pi needs to have a static IP so it isn't subject to change.
The Pi-hole is a SERVER so it needs a STATIC IP ADDRESS to function properly.
As someone who has been assigning static IP's to devices for 20 years, both personally and professionally, I am not understanding where I am failing to assign a static IP. I have specifically stated the static IP of 10.0.10.10 on Pi-Hole OS during configuration. I have never had to once configure my router to allow for this. I have a multitude of networks where I static IP devices outside of my DHCP range and they never ever pull a DHCP address, ever. Sorry if I'm coming off as obstinate but I'm truly confused about how this fixes my problem. If I make a reservation for it at 10.0.10.10 (outside of my DHCP scope), what's to stop it from requesting something inside the DHCP scope of 10.0.10.100 - .200?
Personally, I was wondering why pihole needs a static IP address, if using the pihole v4 default blocking mode. All my devices have a MAC assigned DHCP address. This ensures that all devices always get the same IP address, but allow me to change the DHCP options network wide, or assign specific options for specific hosts from a central point of administration (pfsense in my environment).
What might work is:
copy dhcpcd.conf before installing pihole
install pihole -> dhcpcd.conf now becomes static
copy the original dhcpcd.conf over the one pihole wrote.
This would allow me to move the SD card between my production pi and my test pi's, Since they all have different MAC addresses, I know exactly which IP address to use to reach the different pi's.
Downside of course is you need to watch out for changes made by pihole -r.
I've been using IPv6check.sh to handle the IPv6 address change.
I would very much like to be the static address assignment, during pihole installation, optional.
Have you considered not assigning a static IP at the Pi, but setting the IP via a DHCP reservation on the router? That may bypass whatever is causing your problem.
Another option would be to set the Pi-Hole to listen to the 104 address, since that is what the device sets itself to.
Why the heck is it asking for a DHCP address when I told it to use a static one? Now, if I were running the GUI version I would just go in and disable that Network Profile and create a new one. The problem I have is that I'm running the LITE version and don't know exactly how to do this.