I have pihole runner in a container on my PI with host networking and it is the DHCP server on my network (my router doesn't allow setting DNS so I switched from it being the DHCP server to the Pi).
If I restart my Pi it basically won't do anything until I re-enable the DHCP server on the router at which point I can turn it back off. Before doing this I can see it connect to via wlan/eth0 but it won't respond to pings or ssh and obviously the rest of the network doesn't work properly at this point as it has no DNS or DHCP server.
Assuming there's some misconfiguration like its waiting for its DHCP lease even though it should be the one to give it out?
I'm not sure I understand completely what you're saying, so I'll try to reformulate : Pihole (running on your pi) is the DHCP server for your network. It was previously running on your router, not anymore... unless you have to reboot your pi, so you need to enable DHCP service on your router again to have pihole working again (and you can then disable it from your router). No DNS involved in your story.
If so, it seems to me that the pi network interface serving DHCP (through pihole in a container) does not get an IP address, which would be ironic If so, just give it a static IP address (a DHCP server shouldn't be addressed dynamically).
Tell me if you need any help checking or updating this configuration.
# Example static IP configuration:
#static domain_name_servers=192.168.0.1 184.108.40.206 fd51:42f8:caae:d92e::1
not sure if domain_name_servers should be itself or the upstream and whether i can omit the ip6_address or not.
I also see I could use a fallback:
# It is possible to fall back to a static IP if DHCP fails:
# define static profile
# fallback to static profile on eth0
Might be better as if I happen to put the pi on a different network (say mine is down for some reason) it should try and pick up a lease before assigning itself a static.
There's multiple ways to do it, but this one might not be the best.
See, servers in general should use a static IP address (or a reserved dynamic one) for better availability. That's even more true for a DHCP server. Sure, you could have another DHCP service running elsewhere and configured to address you pi, but it's convoluted, and you'd have to be careful not to overlap DHCP scopes.
What I suggested is stop DHCP client alltogether and set a static IP configuration on you Pi. Here is how you can do it (assuming you're running Debian) :
vi /etc/network/interfaces, and then set something like this :
The idea is : Don't use your DHCP service to address your DHCP server, as you would do for DNS : Don't set your DNS service IP address / hostname as NS server for your DNS server. You want it to be independant of these critical services you're hosting.
Edit : I think that's your issue, but I'm not sure, so perhaps start by checking your interface configuration before commiting any change.
Edit 2 : Just to be clear, setting a static IP address as fallback from DHCP client configuration would work, but I really don't think you should do it like this. It means your Pi would try to get an IP address from you DHCP server (which would not be running), fail, and then get a static one. Services on your machine (like docker) might not start properly in the meantime, and you'd have to restart them after. If for whatever reason they start, containers might crash and restart if you set them in auto restart.
You won't need it ! Having two interfaces addressed on the same network doesn't serve any purpose (without any form of bonding I mean). Worst case scenario, it can mess up with your routes.
You should either not use wifi, or use it to reach another network, if you plan to use your Pi as a router that is.
There are indeed other usecases, but this one (backup interface) is not one I can recommend, not like this.
I wouldn't disable dhcpcd.
Just use the static configuration lines in your dhcpcd.conf.
dhcpcd will then prefer any static option values over the ones provided via other means.
This would be important if your network has IPv6 connectivity. Without dhcpcd, your host may not be able to pick up IPv6 related information like IPv6 prefixes from your router anymore.
pi@ph5b:~ $ apt show ifupdown
Description: high level tools to configure network interfaces
This package provides the tools ifup and ifdown which may be used to
configure (or, respectively, deconfigure) network interfaces based on
interface definitions in the file /etc/network/interfaces.
It still can be used to configure interfaces.
But preferred is to let the OOTB default network manager called dhcpcd to configure all the networking stuff:
pi@ph5b:~ $ man dhcpcd
dhcpcd is an implementation of the DHCP client specified in RFC
2131. dhcpcd gets the host information (IP address, routes, etc)
from a DHCP server and configures the network interface of the ma‐
chine on which it is running. dhcpcd then runs the configuration
script which writes DNS information to resolvconf(8), if available,
otherwise directly to /etc/resolv.conf.
pi@ph5b:~ $ man dhcpcd.conf
Configures a static value. If you set ip_address then
dhcpcd will not attempt to obtain a lease and will just use
the value for the address with an infinite lease time. If
you set ip6_address, dhcpcd will continue auto-configura‐
tion as normal.
Here is an example which configures two static address,
overriding the default IPv4 broadcast address, an IPv4
router, DNS and disables IPv6 auto-configuration. You
could also use the inform6 command here if you wished to
obtain more information via DHCPv6. For IPv4, you should
use the inform ipaddress option instead of setting a static