"pihole -g" geht nicht

Beobachtetes und erwartetes Verhalten

Wenn ich den Befehl pihole -g ausführe bekomme ich folgenden Fehler. Wenn ich allerdings in der resolv.conf Datei den Eintrag von nameserver fd00::ab34:d1ef:4f58:578c in nameserver 192.168.178.1 ändere funktioniert alles. Die resolv.conf wird allerdings immer wieder zurückgesetzt. Wie kann man das Problem beheben ohne immer wieder den Eintrag zu ändern?

bash: warning: setlocale: LC_ALL: cannot change locale (de_DE.UTF-8)
bash: warning: setlocale: LC_ALL: cannot change locale (de_DE.UTF-8)
bash: warning: setlocale: LC_ALL: cannot change locale (de_DE.UTF-8)
  [✗] DNS resolution is currently unavailable
  [i] Time until retry: 119

Benutzte Hardware

  • Raspberry Pi Zero
  • FritzBox 7590

Einstellungen in der FritzBox

  • Heimnetz -> Netzwerk -> Netzwerkeinstellungen -> IPv4 Einstellungen -> Lokaler DNS Server -> IP vom PiHole
  • Heimnetz -> Netzwerk -> Netzwerkeinstellungen -> IPv6 Einstellungen -> Unique Local Addresses -> Unique Local Addresses (ULA) zuweisen, solange keine IPv6-Internetverbindung besteht (empfohlen)
  • Heimnetz -> Netzwerk -> Netzwerkeinstellungen -> IPv6 Einstellungen -> DNSv6-Server im Heimnetz -> IPv6 vom PiHole
  • Heimnetz -> Netzwerk -> Netzwerkeinstellungen -> IPv6 Einstellungen -> DHCPv6-Server im Heimnetz -> Nur DNS-Server zuweisen

What distro are you using, is this Pi-OS/Raspbian?

pi@ph5b:~ $ lsb_release -d
Description:    Raspbian GNU/Linux 11 (bullseye)

For Pi-OS/Raspbian, dhcpcd is responsible for populating /etc/resolv.conf:

pi@ph5b:~ $ man dhcpcd
[..]
DESCRIPTION
     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 machine on
     which it is running.  dhcpcd then runs the configuration script which
     writes DNS information to resolvconf(8), if available, otherwise di‐
     rectly to /etc/resolv.conf.

Did you set static IP details?

pi@ph5b:~ $ man dhcpcd.conf
[..]
     static value
             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-configuration as
             normal.

             Here is an example which configures two static address, over‐
             riding 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 infor‐
             mation via DHCPv6.  For IPv4, you should use the inform
             ipaddress option instead of setting a static address.
                   interface eth0
                   noipv6rs
                   static ip_address=192.168.0.10/24
                   static broadcast_address=192.168.0.63
                   static ip6_address=fd51:42f8:caae:d92e::ff/64
                   static routers=192.168.0.1
                   static domain_name_servers=192.168.0.1
                   fd51:42f8:caae:d92e::1

             Here is an example for PPP which gives the destination a de‐
             fault route.  It uses the special destination keyword to in‐
             sert the destination address into the value.
                   interface ppp0
                   static ip_address=
                   destination routers

You can set static IP details in below file at the bottom (below example is my Pi-hole host):

pi@ph5b:~ $ sudo nano /etc/dhcpcd.conf
[..]
interface eth0
  static ip_address=10.0.0.4/24
  static routers=10.0.0.1
  static domain_name_servers=10.0.0.1

The static domain_name_servers= value will end up in resolv.conf as a nameserver.
The 10.0.0.1 DNS server address above is my router but you could also opt to supply your ISP DNS servers or public DNS providers like for example Google, Cloudflare etc:

pi@ph5b:~ $ cat /etc/pihole/dns-servers.conf
Google (ECS, DNSSEC);8.8.8.8;8.8.4.4;2001:4860:4860:0:0:0:0:8888;2001:4860:4860:0:0:0:0:8844
OpenDNS (ECS, DNSSEC);208.67.222.222;208.67.220.220;2620:119:35::35;2620:119:53::53
Level3;4.2.2.1;4.2.2.2;;
Comodo;8.26.56.26;8.20.247.20;;
DNS.WATCH (DNSSEC);84.200.69.80;84.200.70.40;2001:1608:10:25:0:0:1c04:b12f;2001:1608:10:25:0:0:9249:d69b
Quad9 (filtered, DNSSEC);9.9.9.9;149.112.112.112;2620:fe::fe;2620:fe::9
Quad9 (unfiltered, no DNSSEC);9.9.9.10;149.112.112.10;2620:fe::10;2620:fe::fe:10
Quad9 (filtered, ECS, DNSSEC);9.9.9.11;149.112.112.11;2620:fe::11;2620:fe::fe:11
Cloudflare (DNSSEC);1.1.1.1;1.0.0.1;2606:4700:4700::1111;2606:4700:4700::1001

When change any and reboot, you can see what dhcpcd does with below:

journalctl --full --no-pager -u dhcpcd

It doesnt show the populating of resolv.conf though.

Below guide to configure Fritzbox doesnt show how to setup for IPv6:

But you dont need IPv6 DNS for your clients to resolve DNS names to IPv6 or IPv4 IP's.
Clients can resolve IPv6 addresses through IPv4 and vice versa (KISS):

Something is wrong with your locals.
What does below show?

locale -a

If de_DE.UTF-8 is listed in below file and hashed out (like below), try unhash it and save/exit:

pi@ph5b:~ $ sudo nano /etc/locale.gen
[..]
# de_DE ISO-8859-1
# de_DE.UTF-8 UTF-8
# de_DE@euro ISO-8859-15
[..]

Run below to generate the de_DE.UTF-8 local:

sudo locale-gen

And check if output is in German now with below (change nl_NL.UTF-8 into de_DE.UTF-8):

pi@ph5b:~ $ LC_ALL=nl_NL.UTF-8 date
zo  9 okt 2022 13:55:34 CEST

Vs:

pi@ph5b:~ $ date
Sun  9 Oct 13:56:17 CEST 2022

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