No internet connection


I’ve been using dietpi on my rpi B (ver1) for a while without any problem. Today I was trying to install pihole via dietpi-software menu. While installation I got an error about not able to connecting to After that I checked internet connection of the rpi and i couldn’t ping any page. I reboot rpi many times. I am connecting to my rpi through ssh via my laptop. So rpi is connected to local network but cannot connect to internet. Any idea?

I’ve found the problem. During installation process the record in /etc/resolv.conf changes to After changing it to any DNS server ip, it starts working. Why the resolv.conf changes this way?

usually this is not triggered by DietPi directly to adjus/change /etc/resolv.conf. Normal way to adjust DNS settings in DietPi would be using dietpi-config

Did you tried to set PiHole on some other way before? Or did you performed some other software installation upfront?

I just upgraded dietpi to latest version prior installation. After first attempt I uninstall and install again. Same behaviour happened.

that’s strange. I did a test installation of Pihole without issues. As well my /etc/resolv.conf did not change and is still pointing to the DNS server I have setup before using DHCP.

Even more strange, as you are failing somewhere in the middle of the installation. Their are quite some steps before, like installation of Lighttpd, PHP, SQLite and Git Client, which require internet connection as well. Not sure what is going to change /etc/resolv.conf for you.

Any ideas.

What’s the output of:

head -n -0 /etc/resolv.conf 
head -n -0 /etc/resolvconf/resolv.conf.d/*

Nothing is touching /etc/resolv.conf directly, neither in DietPi code nor in Pi-hole code. Probably the DHCP server is doing mad things, or dhcpcd, installed by Pi-hole as dependency (while not really being one). Purging and/or masking dhcpcd could be at least tested:

apt purge dhcpcd5
systemctl mask dhcpcd

Then running the Pi-hole installer. I hope the mask does not break the package install. With this, it could be at least ruled out that dhcpcd has anything to do with it.