Unable to update "Temporary failure resolving"

I’m having a weird issue with my DietPi instance, when I try to do

sudo apt-get update

Everything just fails with a message about Temporary failure resolving e.g.

Failed to fetch > http://raspbian.raspberrypi.org/raspbian/dists/buster/InRelease > Temporary failure resolving ‘raspbian.raspberrypi.org
W: Failed to fetch > https://download.mono-project.com/repo/debian/dists/raspbianbuster/InRelease > Temporary failure resolving ‘download.mono-project.com
W: Failed to fetch > https://downloads.plex.tv/repo/deb/dists/public/InRelease > Temporary failure resolving ‘downloads.plex.tv

If I go into dietpi-config and run a network test it fails BUT if I use my phone and disconnect from my wifi and enable 3G I can successfully connect and watch my media on the plex server the pi is running so it must be connected to the internet.

The Pi is connected by ethernet direct to my Sky hub.

Him

you would need to check why you are not able to resolve DNS request on your side. can you ping 8.8.8.8 or ping dns.google. Do you use something like PiHole?

When I try to ping dns.google I get the same:

root@DietPi:~# ping dns.google
ping: dns.google: Temporary failure in name resolution

But for 8.8.8.8 it just carried on until I stopped it:

64 bytes from 8.8.8.8: icmp_seq=199 ttl=119 time=8.03 ms
64 bytes from 8.8.8.8: icmp_seq=200 ttl=119 time=7.57 ms
64 bytes from 8.8.8.8: icmp_seq=201 ttl=119 time=7.83 ms
64 bytes from 8.8.8.8: icmp_seq=202 ttl=119 time=7.52 ms
^C
— 8.8.8.8 ping statistics —
202 packets transmitted, 202 received, 0% packet loss, time 517ms

I don’t use pi-hole anymore.

can you check DNS server used

cat /etc/resolv.conf

Thank’s that was it, the nameserver was my old pi-hole instance which was set as the secondary DNS I set it to tthe same as my primary DNS and I can now update.

pls do the settings using dietpi-config to be permanent