Apt-get update is not working - Temporary failure resolving 'raspbian.raspberrypi.org'

Hi
sudo apt-get update is not working on my pihole:

pi@raspberrypi:~ $ sudo apt-get update
Err:1 Index of /raspbian bullseye InRelease
Temporary failure resolving 'raspbian.raspberrypi.org'
Err:2 Index of /debian bullseye InRelease
Temporary failure resolving 'archive.raspberrypi.org'
Reading package lists... Done
W: Failed to fetch http://raspbian.raspberrypi.org/raspbian/dists/bullseye/InRelease Temporary failure resolving 'raspbian.raspberrypi.org'
W: Failed to fetch http://archive.raspberrypi.org/debian/dists/bullseye/InRelease Temporary failure resolving 'archive.raspberrypi.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

when:
sudo nano /etc/resolv.conf

output is:

Generated by resolvconf

nameserver fe80:2131:8759:4045:5378::%eth0

there are 2 :: instead of 1 :
when removing one : to = nameserver fe80:2131:8759:4045:5378:%eth0

apt-get update is working! but this change wont long last. after few hour its switched to 2 :: again.

what wrong with my pihole?
i did a debug as well:
[✓] Your debug token is: https://tricorder.pi-hole.net/QQj072Pm/

Thanks so far for your help

The file /etc/resolv.conf has IP addresses of DNS servers which your OS can use to resolve external domains, for example to perform updates. It would normally contain one or more IPv4 addresses, and possibly one or more IPv6 addresses.

Yours contains only that single fe80 IPv6 address, and that address will only work for reaching IPv6 devices on your network. That looks like the reason you cannot resolve any external domains, for example raspbian.raspberrypi.org.

To fix this temporarily, edit the file again, delete everything in there and add the IPv4 address of a known good DNS resolver, for example Cloudflare's one:

nameserver 1.1.1.1

Now you will be able to run updates while this entry remains in place.

The double colon in the IPv6 address was correct – the issue was the fact that it was a local-only IPv6 address.

If /etc/resolv.conf is being edited by something every few hours, it sounds like something on your system is managing it for you. Possibly Network Manager, but I've not used it enough to know if it does what you are seeing. You may find that even if the fe80 address is added back, the 1.1.1.1 will remain and you can still update your OS and Pi-hole. It is still worth tracking down the cause though and fixing it.

Hi Chris.

thanks for your help.
the fe80 adress is the ipv6 adress of the pihole in the network.
when adding nameserver 1.1.1.1 additional and not removing the fe80 adress it is working.

but dont know for how long, i guess the resolv.conf will be edited automatically later...

This file is populated from another process on boot. Typically, the first line of the file tells you the process.

Example:

cat /etc/resolv.conf
# Generated by dhcpcd from enxb827eb0c8c4f.dhcp
# /etc/resolv.conf.head can replace this line
nameserver 127.0.0.1
# /etc/resolv.conf.tail can replace this line

Typically it is dhcpcd or Network Manager.

Change the configuration file at the source to make the change permanent.

For example, if dhcpcd controls, change /etc/dhcpcd.conf.

Greetings! I have built a PiHole instance, and also just got set up on these forums, and have encountered this same problem. I have 3 Raspberry Pi units and this situation applies to myself, also.

Could a step-by-step set of instructions be provided(namely the what, where and how)? I use DD-WRT on my router.

Thank you very much and it is greatly appreciated.

[[[UPDATE]]] - I have worked with an associate and I've accomplished fixing this...

  • Went into /etc/NetworkManager/NetworkManager.conf using Nano (my preferred editor).
  • In [Main], added the following lines:
  • #Below are added DNS items
  • dns=84.200.69.80
  • dns=84.200.70.40

Saved, exited and rebooted. With that, I was able to re-establish connection to the repositories. PiHole remains online and behaving, normally.

Out of interest, now that you've done that, what do you see in /etc/resolv.conf? Do you see the same entries and a note that it is managed by Network Manager?

cat /etc/resolv.conf

This may help the OP or others who find that file being modified automatically.

I see a search entry pointing to my ISP and a nameserver entry pointing to my PiHole's IP in my network.

Glad to be of assistance! :smiley:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.