Error DNS resolution is currently unavailable when updating gravity list

Hello,
I have trouble making my pi-hole work, it is kinda working receiving and blocking some querry but i cannot update gravity list, when i try via the web interface or via SSH (pihole -g) i get this error:
root@DietPi:~# pihole -g
[✗] DNS resolution is currently unavailable
[✗] DNS resolution is not available

I have a Raspberry pi 3B running Dietpi

I tried to go into dietpi-config,

i did a connexion test:
root@DietPi:~# dietpi-config
[ .. ] DietPi-Config | Checking URL: https://dietpi.com (1/2)
[ .. ] DietPi-Config | Checking URL: https://dietpi.com (2/2)
[FAILED] DietPi-Config | Checking URL: https://dietpi.com

I checked all topic and tried to change withsudo nano /etc/resolv.conf
to nameserver 192.168.2.5
and nameserver 127.0.0.1
and google DNS nameserver 8.8.8.8
...nothing seems to work.

here is my router config


can someone tell me how to fix it ?

Expected Behaviour:

i should be able to run pihole -g and add adlist

Actual Behaviour:

i get an error

Debug Token:

i cannot upload it, here is copy paste :

Removed by moderator and made private.

*** [ DIAGNOSING ]: SELinux
[i] SELinux not detected

*** [ DIAGNOSING ]: FirewallD
[i] Firewalld service inactive

*** [ DIAGNOSING ]: Operating system
[i] dig return code:  10
[i] dig response:  dig: couldn't get address for 'ns1.pi-hole.net': failure
[✗] Distro:  Debian
[✗] Error: Debian is not a supported distro (https://docs.pi-hole.net/main/prerequisites/)

** [ DIAGNOSING ]: Networking
[✓] IPv4 address(es) bound to the eth0 interface:
   192.168.2.5/24 matches the IP found in /etc/pihole/setupVars.conf

[i] Default IPv4 gateway: 192.168.2.1
   *** Pinging 192.168.2.1...**
**[✗] Gateway did not respond. (https://discourse.pi-hole.net/t/why-is-a-default-gateway-important-for-pi-hole/3546)**

*** [ DIAGNOSING ]: Name resolution (IPv4) using a random blocked domain and a known ad-serving domain
[✓] ch-wf.taboola.com is 0.0.0.0 via localhost (127.0.0.1)
[✓] ch-wf.taboola.com is 0.0.0.0 via Pi-hole (192.168.2.5)
**[✗] Failed to resolve doubleclick.com via a remote, public DNS server (8.8.8.8)**

*** [ DIAGNOSING ]: Discovering active DHCP servers (takes 10 seconds)
   Scanning all your interfaces for DHCP servers
   Timeout: 10 seconds

   * Received 341 bytes from eth0:192.168.2.1
     Offered IP address: *** [ DIAGNOSING ]: SELinux
[i] SELinux not detected

*** [ DIAGNOSING ]: FirewallD
[i] Firewalld service inactive192.168.2.69
     Server IP address: N/A
     Relay-agent IP address: N/A
     BOOTP server: (empty)
     BOOTP file: (empty)
     DHCP options:
      Message type: DHCPOFFER (2)
      server-identifier: 192.168.2.1
      lease-time: 259200 ( 3d )
      netmask: 255.255.255.0
      router: 192.168.2.1
      dns-server: 192.168.2.1
      dns-server: 192.168.2.5
      renewal-time: 129600 ( 1d 12h )
      rebinding-time: 226800 ( 2d 15h )
      broadcast: 192.168.2.255
         domain-name: "home"
      --- end of options ---

   DHCP packets received on interface lo: 0
   DHCP packets received on interface eth0: 1

   Jul 26 17:17:10 dnsmasq[381]: query[A] discourse.pi-hole.net from 192.168.2.10
   Jul 26 17:17:10 dnsmasq[381]: forwarded discourse.pi-hole.net to 8.8.4.4
   Jul 26 17:17:10 dnsmasq[381]: forwarded discourse.pi-hole.net to 8.8.8.8

You have some network connectivity issues. Your Pi-hole does receive queries from other clients and forwards them but does not get an answer from your upstream DNS servers (like 8.8.8.8).

Do you have any firewall in place? Is something preventing your pi device from sending queries on port 53 to the internet?

Hi Yubiuser
I dont think i have a firewall, it would be on my router/modem or in the pi right ?

The pi is just a diet pi install, and i dont see a firewall config in my router

in port fowarding there is my qbittorent and plex server, would port fowarding to 192.168.2.5 help ?
i think the problem come from my dietpi config

I am new to raspberry pi, I followed this tutorial...

Unsure why it doesnt work for me...

The gateway does not even respond to a regular ping, according to the debug log. Can you verify this:

ping 192.168.2.1

yeah i cannot ping it
root@DietPi:~# ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
From 192.168.2.5 icmp_seq=1 Destination Host Unreachable
From 192.168.2.5 icmp_seq=2 Destination Host Unreachable
From 192.168.2.5 icmp_seq=3 Destination Host Unreachable
From 192.168.2.5 icmp_seq=4 Destination Host Unreachable
From 192.168.2.5 icmp_seq=5 Destination Host Unreachable
From 192.168.2.5 icmp_seq=6 Destination Host Unreachable
From 192.168.2.5 icmp_seq=7 Destination Host Unreachable
From 192.168.2.5 icmp_seq=8 Destination Host Unreachable
From 192.168.2.5 icmp_seq=9 Destination Host Unreachable
From 192.168.2.5 icmp_seq=10 Destination Host Unreachable
From 192.168.2.5 icmp_seq=11 Destination Host Unreachable
From 192.168.2.5 icmp_seq=12 Destination Host Unreachable
From 192.168.2.5 icmp_seq=13 Destination Host Unreachable
From 192.168.2.5 icmp_seq=14 Destination Host Unreachable
From 192.168.2.5 icmp_seq=20 Destination Host Unreachable
From 192.168.2.5 icmp_seq=21 Destination Host Unreachable
From 192.168.2.5 icmp_seq=23 Destination Host Unreachable
From 192.168.2.5 icmp_seq=24 Destination Host Unreachable
From 192.168.2.5 icmp_seq=26 Destination Host Unreachable
^C
--- 192.168.2.1 ping statistics ---
28 packets transmitted, 0 received, +19 errors, 100% packet loss, time 673ms
pipe 4

And, just to rule it out, a HTTP connection does not work either, does it?

curl -IL 192.168.2.1

How did you apply 192.168.2.5 first, only and initially as static IP on DietPi or did you set this actively in the router as well? Probably it works when you actively set this as reserved IP in the router settings. Or, as it is not withing the DHCP range, give it a reserved IP within the DHCP range and switch back to DHCP on DietPi temporarily. If it works, then assign that reserved IP as static IP.

root@DietPi:~# curl -IL 192.168.2.1
curl: (7) Failed to connect to 192.168.2.1 port 80: No route to host

the 192.168.2.5 static pi was set on dietpi after making sure it was out the the dhcp range

here is the setting on the dietpi from my router

There seems to be no valid default route configured. Can you show:

ip r

And a guess what might interfere:

systemctl disable --now dhcpcd
ifup --force eth0

here is the result :

root@DietPi:~# ip r
default via 192.168.2.1 dev eth0 onlink
192.168.2.0/24 dev eth0 proto kernel scope link src 192.168.2.5

root@DietPi:~# systemctl disable --now dhcpcd
Synchronizing state of dhcpcd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable dhcpcd
Removed /etc/systemd/system/multi-user.target.wants/dhcpcd.service.
Removed /etc/systemd/system/dhcpcd5.service.
root@DietPi:~# ifup --force eth0
RTNETLINK answers: File exists
root@DietPi:~#
pie

Routes look actually good.

If it still does not work (ping or curl the router), then at best reapply the settings and dietpi-config and reboot.

Else it must be blocked at the router, which probably does not route any packets from clients outside the DHCP range, and I suggest to try what I wrote above: Use DHCP but assign a reserved IP for that device inside the router settings, so that the IP does not change. That IP can then be assigned as static IP on DietPi as well.

So i changed the dietpi to DHCP, then my router gave me the ip 192.168.2.68, i then went in my router and reserved the ip 192.168.2.15 (which is inside my DHCP range)
image

then i went into my diet pi to change it back to static IP, and set the IP to 192.168.2.15


I had to reboot the pi/router for my pi to show up

i then went in the DNS page of my router to set it to 192.168.2.15

i connected via SSH and did ping 192.168.2.1 and i get the same result
root@DietPi:~# ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
From 192.168.2.15 icmp_seq=21 Destination Host Unreachable
From 192.168.2.15 icmp_seq=22 Destination Host Unreachable
From 192.168.2.15 icmp_seq=23 Destination Host Unreachable

Can you ping the router from any other device, actually? Unlikely, but probably it does not answer to ICMP.

And what does

curl -IL 192.168.2.1

say now? The better tool to debug here, as the ping error message is very unspecific.

If things still do not work, please show the following output so we can check the whole picture of low level network setup:

ip l
ip a
ip r

Yes i can ping 192.168.2.1 from my main computer.

root@DietPi:~# curl -IL 192.168.2.1
curl: (7) Failed to connect to 192.168.2.1 port 80: No route to host
root@DietPi:~# ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether b8:27:eb:fa:be:aa brd ff:ff:ff:ff:ff:ff
root@DietPi:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:fa:be:aa brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.15/24 brd 192.168.2.255 scope global eth0
       valid_lft forever preferred_lft forever
root@DietPi:~# ip r
default via 192.168.2.1 dev eth0 onlink
192.168.2.0/24 dev eth0 proto kernel scope link src 192.168.2.15

So no one has a fix ?
Should i try formating the SD card and reinstalling dietpi or maybe i try an other os ?

Local firewall?

sudo iptables -nL

Can you see neighbors?

ip n | awk '{print $3 " " $1}'

it says command not found :
root@DietPi:~# sudo iptables -nL
sudo: iptables: command not found

it see neighbors:
root@DietPi:~# ip n | awk '{print $3 " " $1}'
eth0 192.168.2.31
eth0 192.168.2.70
eth0 192.168.2.20
eth0 192.168.2.50
eth0 192.168.2.63
eth0 192.168.2.30
eth0 192.168.2.43
eth0 192.168.2.23
eth0 192.168.2.45
eth0 192.168.2.25
eth0 192.168.2.42
eth0 192.168.2.22
eth0 192.168.2.44
eth0 192.168.2.57
eth0 192.168.2.24
eth0 192.168.2.47
eth0 192.168.2.14
eth0 192.168.2.27
eth0 192.168.2.36
eth0 192.168.2.49
eth0 192.168.2.16
eth0 192.168.2.29
eth0 192.168.2.46
eth0 192.168.2.26
eth0 192.168.2.48
eth0 192.168.2.19
eth0 192.168.2.41
eth0 192.168.2.21
eth0 192.168.2.51
eth0 192.168.2.1
eth0 192.168.2.18

That package does not ship with DietPi.

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