If I remove the network cable, or restart the modem, the interface loses the ip and no longer obtains an IP, it only resolves by restarting Linux. I think the pihole does not enable the auto flag in eth0?
*** [ DIAGNOSING ]: Networking
[✓] IPv4 address(es) bound to the enp1s0 interface:
192.168.0.222/24 matches the IP found in /etc/pihole/setupVars.conf
192.168.0.44/24 does not match the IP found in /etc/pihole/setupVars.conf
Did you configure a static IP an your device hosting Pi-hole? Or a static IP assignment on your router for your Pi-hole device?
The dhcp of my modem was sending the ip 192.168.0.44 to pihole and the LAN interface was getting 2 ips, i change the DHCP reserved IP on modem to 192.168.0.222 and now there is only one ip on the interface, but the cable disconnect and losing IP issue is the same.
*** [ DIAGNOSING ]: Networking
[✓] IPv4 address(es) bound to the enp1s0 interface:
192.168.0.222/24 matches the IP found in /etc/pihole/setupVars.conf
You device is configured to get an IP via DHCP and your router has reserved IP for that device. If you unplug the cable from your device it looses the connection and therefore looses the assigned IP. If you re-plug the cable it should get the same IP as before via DHCP.
If you don't want to "loose" the IP during the disconnect (but there is no physical connection anyway) you need to configure a static IP on the device itself
I read somewhere around here that I shouldn't make manual changes to the ip configuration files ... could you tell me in which file should I insert this information? because I already tried the file / etc / network / interfaces
but it does not auto assign IP after disconnection.
There will be an entry similar to this for each interface. In this case, the ethernet interface on this device is eth0, the static IP is 160, and the device is using Pi-hole for DNS resolution on the loopback interface.
Restart the Pi-hole host and run another debug log and look in the section near the top where Pi-hole checks your DHCP server. You will see that your DHCP server (the router) is offering the Pi the correct address, which matches the IP for which you have Pi-hole configured.
But, your router is also passing a second DNS server to clients, and that server is not the Pi-hole. That will allow some DNS traffic to bypass Pi-hole.
I put this DNS2 intentionally, because if the Pi-Hole turns off for some reason, my users access the secondary dns that is from NextDns.io, which actually does all the filtering, I'm using the pi-hole just to have a fast cache on the local network.