Cannot resolve name server after moving to another network

Description:
I moved my PiHole RP from 192.168.0.x to 192.168.8.x
I run pihole -r and it worked once, after that I got error pihole couldn't resolve host 'ns1.pi-hole.net'

Expected Behaviour:

repair command works properly
hardware: rp 0w

Actual Behaviour:

error pihole couldn't resolve host 'ns1.pi-hole.net'

Debug Token:

it couldn't upload the debug report, but I'll attach it to the topic

https://pastebin.com/YgY7zXHC

Potential solutions so far:

  • I removed resolv.config file and replaced it with 8.8.8.8 but when I restarted my RP it is back to 127.0.0.1
  • I'm using Unbound dns, but I changed the DNS from PiHole admin page from using the local one 127.0.0.1#5335 to use Google's

If IP has changed, you shouldnt run repair but select reconfigure to tell Pi-hole of the changes:

pihole -r

When you changed the IP of the Pi, you did not change the configuration of Pi-hole to use the new IP.

*** [ DIAGNOSING ]: Networking

[✓] IPv4 address(es) bound to the wlan0 interface:

192.168.8.105/24 does not match the IP found in /etc/pihole/setupVars.conf (https://discourse.pi-hole.net/t/use-ipv6-ula-addresses-for-pi-hole/2127)

PIHOLE_INTERFACE=wlan0
IPV4_ADDRESS=192.168.0.5/24

You can manually edit /etc/pihole/setupVars.conf and change the IPV4_ADDRESS to 192.168.8.105/24.

Then restart FTL with pihole restartdns

I get error

dig: couldn't get address for 'ns1.pi-hole.net': failure

thank you. I changed it manually rebooted dns, rebooted RP, but still getting the same error

again couldn't upload the new debug report, you can find it here
https://pastebin.com/isKFxfZf

    * Using curl for transmission.
    * curl failed, falling back to netcat for transmission.
nc: getaddrinfo for host "tricorder.pi-hole.net" port 9999: Temporary failure in name resolution
[✗]  There was an error uploading your debug log.
   * Please try again or contact the Pi-hole team for assistance.
   * A local copy of the debug log can be found at: /var/log/pihole_debug.log```

What did you enter ?
Can you post full command with output pls ?
Also what does below show ?

sudo grep -v '^\s*#\|^\s*$' /etc/dhcpcd.conf

pi@raspberrypi:~ $ pihole -r

  [✓] Root user check

        .;;,.
        .ccccc:,.
         :cccclll:.      ..,,
          :ccccclll.   ;ooodc
           'ccll:;ll .oooodc
             .;cll.;;looo:.
                 .. ','.
                .',,,,,,'.
              .',,,,,,,,,,.
            .',,,,,,,,,,,,....
          ....''',,,,,,,'.......
        .........  ....  .........
        ..........      ..........
        ..........      ..........
        .........  ....  .........
          ........,,,,,,,'......
            ....',,,,,,,,,,,,.
               .',,,,,,,,,'.
                .',,,,,,'.
                  ..'''.

  [✓] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 7.3.19-1~deb10u1
  [i] Reconfigure option selected
  [✓] Disk space check

  [✓] Checking apt-get for upgraded packages... up to date!

  [i] Installer Dependency checks...
  [✓] Checking for dhcpcd5
  [✓] Checking for git
  [✓] Checking for iproute2
  [✓] Checking for whiptail
  [✓] Checking for dnsutils

dig: couldn't get address for 'ns1.pi-hole.net': failure
pi@raspberrypi:~ $ sudo grep -v '^\s*#\|^\s*$' /etc/dhcpcd.conf
hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
require dhcp_server_identifier
slaac private
interface wlan0
        static ip_address=192.168.8.105/24
        static routers=192.168.8.1
        static domain_name_servers=8.8.8.8 8.8.4.4

dig ns1.pi-hole.net @8.8.8.8

?

What is the output of the following from the Pi terminal:

dig ns1.pi-hole.net

1 Like

lol :smiley:
Its called tandem troubleshooting :wink:

1 Like
pi@raspberrypi:~ $ dig ns1.pi-hole.net @8.8.8.8

; <<>> DiG 9.11.5-P4-5.1+deb10u1-Raspbian <<>> ns1.pi-hole.net @8.8.8.8
;; global options: +cmd
;; connection timed out; no servers could be reached

pi@raspberrypi:~ $ dig ns1.pi-hole.net

; <<>> DiG 9.11.5-P4-5.1+deb10u1-Raspbian <<>> ns1.pi-hole.net
;; global options: +cmd
;; connection timed out; no servers could be reached

You have a connectivity problem on your network if you can't reach any name servers.

The first dig should completely bypass any internal DNS servers and go directly to the Google DNS server.

Do you have any firewalls or re-directs for DNS traffic on port 53?

traceroute -n 8.8.8.8

?

Check your router for below:

Might have to configure the new IP to be allowed by rebind protection (if have any).

nothing that I know of actually :confused:

pi@raspberrypi:~ $ traceroute -n 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
 1  192.168.8.1  2.660 ms  2.081 ms  3.881 ms
 2  192.168.0.1  5.688 ms  5.001 ms  4.838 ms
 3  83.169.183.45  42.528 ms  38.996 ms  39.743 ms
 4  88.134.234.201  37.617 ms 88.134.234.203  37.627 ms 88.134.234.201  36.280 ms
 5  145.254.3.66  36.886 ms  35.724 ms 145.254.3.92  34.518 ms
 6  145.254.2.217  34.671 ms  37.276 ms  36.336 ms
 7  145.254.2.217  37.299 ms  34.224 ms 145.254.2.215  31.946 ms
 8  72.14.194.138  31.468 ms  43.416 ms  37.840 ms
 9  * * *
10  8.8.8.8  35.802 ms  39.741 ms  38.148 ms

Check rebind protection or similar on the router!

Check local firewall:

pi@ph5:~ $ sudo iptables -nL
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
pi@raspberrypi:~ $ sudo iptables -nL
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:1194

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
DOCKER-USER  all  --  0.0.0.0/0            0.0.0.0/0           
DOCKER-ISOLATION-STAGE-1  all  --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
DOCKER     all  --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
ACCEPT     all  --  10.8.0.0/24          0.0.0.0/0           

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain DOCKER (1 references)
target     prot opt source               destination         

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target     prot opt source               destination         
DOCKER-ISOLATION-STAGE-2  all  --  0.0.0.0/0            0.0.0.0/0           
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           

Chain DOCKER-ISOLATION-STAGE-2 (1 references)
target     prot opt source               destination         
DROP       all  --  0.0.0.0/0            0.0.0.0/0           
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           

Chain DOCKER-USER (1 references)
target     prot opt source               destination         
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           

Try flush all those rules for diagnosing.
Might want to do this on console as you might get kicked from ssh.

And check below again:

dig ns1.pi-hole.net @8.8.8.8

To restore the Netfilter(iptables) rules, just reboot.

pi@raspberrypi:~ $ sudo iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

pi@raspberrypi:~ $ dig ns1.pi-hole.net @8.8.8.8

; <<>> DiG 9.11.5-P4-5.1+deb10u1-Raspbian <<>> ns1.pi-hole.net @8.8.8.8
;; global options: +cmd
;; connection timed out; no servers could be reached