# Cannot resolve name server after moving to another network

**URL:** <https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425>\
**Category:** Help\
**Created:** [August 19, 2020, 12:49pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425 "2020-08-19T12:49:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![amratya01](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/amratya01/32/18170_2.png) [@amratya01](https://discourse.pi-hole.net/u/amratya01)\
**Post date:** [August 19, 2020, 12:49pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/1 "2020-08-19T12:49:57Z")

</div>

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

```auto
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

---

<div class="post-metadata">

**Author:** ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)\
**Post date:** [August 19, 2020, 1:20pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/2 "2020-08-19T13:20:50Z")

</div>

> [@amratya01](#):
>
> 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](http://ns1.pi-hole.net)'

> [@amratya01](#):
>
> repair command works properly

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

`pihole -r`

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [August 19, 2020, 1:24pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/3 "2020-08-19T13:24:52Z")

</div>

> [@amratya01](#):
>
> I moved my PiHole RP from 192.168.0.x to 192.168.8.x

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

```auto
*** [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`

---

<div class="post-metadata">

**Author:** ![amratya01](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/amratya01/32/18170_2.png) [@amratya01](https://discourse.pi-hole.net/u/amratya01)\
**Post date:** [August 19, 2020, 1:35pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/5 "2020-08-19T13:35:34Z")

</div>

I get error

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

```

---

<div class="post-metadata">

**Author:** ![amratya01](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/amratya01/32/18170_2.png) [@amratya01](https://discourse.pi-hole.net/u/amratya01)\
**Post date:** [August 19, 2020, 1:36pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/6 "2020-08-19T13:36:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amratya01](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/amratya01/32/18170_2.png) [@amratya01](https://discourse.pi-hole.net/u/amratya01)\
**Post date:** [August 19, 2020, 2:02pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/7 "2020-08-19T14:02:49Z")

</div>

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

````auto
    * 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```
````

---

<div class="post-metadata">

**Author:** ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)\
**Post date:** [August 19, 2020, 2:11pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/8 "2020-08-19T14:11:02Z")

</div>

> [@amratya01](#):
>
> I get error
> 
> `dig: couldn't get address for 'ns1.pi-hole.net': failure`

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`

---

<div class="post-metadata">

**Author:** ![amratya01](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/amratya01/32/18170_2.png) [@amratya01](https://discourse.pi-hole.net/u/amratya01)\
**Post date:** [August 19, 2020, 2:13pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/9 "2020-08-19T14:13:41Z")

</div>

```auto
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

```

```auto
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

```

---

<div class="post-metadata">

**Author:** ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)\
**Post date:** [August 19, 2020, 2:26pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/10 "2020-08-19T14:26:45Z")

</div>

> [@amratya01](#):
>
> `dig: couldn't get address for 'ns1.pi-hole.net': failure`

`dig ns1.pi-hole.net @8.8.8.8`

?

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [August 19, 2020, 2:26pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/11 "2020-08-19T14:26:54Z")

</div>

> [@amratya01](#):
>
> dig: couldn't get address for 'ns1.pi-hole.net': failure

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

`dig ns1.pi-hole.net`

---

<div class="post-metadata">

**Author:** ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)\
**Post date:** [August 19, 2020, 2:27pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/12 "2020-08-19T14:27:43Z")

</div>

lol 😃  
Its called tandem troubleshooting 😉

---

<div class="post-metadata">

**Author:** ![amratya01](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/amratya01/32/18170_2.png) [@amratya01](https://discourse.pi-hole.net/u/amratya01)\
**Post date:** [August 19, 2020, 2:28pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/13 "2020-08-19T14:28:49Z")

</div>

```auto
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

```

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [August 19, 2020, 2:32pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/14 "2020-08-19T14:32:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)\
**Post date:** [August 19, 2020, 2:32pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/15 "2020-08-19T14:32:52Z")

</div>

`traceroute -n 8.8.8.8`

?

Check your router for below:

> [@Why won't Pi-hole work with DNS rebind protection enabled?](https://discourse.pi-hole.net/t/why-wont-pi-hole-work-with-dns-rebind-protection-enabled/3142):
>
> What is DNS rebind protection? If your router has an option called DNS rebind protection enabled, you may run into issues when trying to use Pi-hole as your DNS server. The reasons for this are quite technical, but to summarize what this option does in one sentence: DNS rebind protection does not allow DNS queries to be answered with a local IP address. Why does this interfere with Pi-hole? DNS rebind is meant to be a [countermeasure to an attack on your network](http://www.techrepublic.com/blog/it-security/public-ip-dns-rebinding-another-reason-not-to-use-default-passwords/). So in many cases, it's actu…

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

---

<div class="post-metadata">

**Author:** ![amratya01](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/amratya01/32/18170_2.png) [@amratya01](https://discourse.pi-hole.net/u/amratya01)\
**Post date:** [August 19, 2020, 2:37pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/16 "2020-08-19T14:37:07Z")

</div>

nothing that I know of actually 😕

---

<div class="post-metadata">

**Author:** ![amratya01](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/amratya01/32/18170_2.png) [@amratya01](https://discourse.pi-hole.net/u/amratya01)\
**Post date:** [August 19, 2020, 2:37pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/17 "2020-08-19T14:37:18Z")

</div>

```auto
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

```

---

<div class="post-metadata">

**Author:** ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)\
**Post date:** [August 19, 2020, 2:38pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/18 "2020-08-19T14:38:43Z")

</div>

Check rebind protection or similar on the router!

> [@jfb](#):
>
> Do you have any firewalls or re-directs for DNS traffic on port 53?

> [@amratya01](#):
>
> nothing that I know of actually 😕

Check local firewall:

```auto
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

```

---

<div class="post-metadata">

**Author:** ![amratya01](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/amratya01/32/18170_2.png) [@amratya01](https://discourse.pi-hole.net/u/amratya01)\
**Post date:** [August 19, 2020, 2:42pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/19 "2020-08-19T14:42:55Z")

</div>

```auto
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           

```

---

<div class="post-metadata">

**Author:** ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)\
**Post date:** [August 19, 2020, 2:49pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/20 "2020-08-19T14:49:06Z")

</div>

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

> [@Admin page shows FTL Offline | Unable to start, cannot access dhcp.leases](https://discourse.pi-hole.net/t/admin-page-shows-ftl-offline-unable-to-start-cannot-access-dhcp-leases/14129/21):
>
> Below ones seems to do the trick: sudo iptables -F sudo iptables -X sudo iptables -t nat -F sudo iptables -t nat -X sudo iptables -t nat -L -n -v sudo iptables -t mangle -F sudo iptables -t mangle -X sudo iptables -P INPUT ACCEPT sudo iptables -P OUTPUT ACCEPT sudo iptables -P FORWARD ACCEPT Check afterwards with: pi@noads:~ $ sudo iptables -L -n Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source …

And check below again:

`dig ns1.pi-hole.net @8.8.8.8`

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

---

<div class="post-metadata">

**Author:** ![amratya01](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/amratya01/32/18170_2.png) [@amratya01](https://discourse.pi-hole.net/u/amratya01)\
**Post date:** [August 19, 2020, 2:51pm UTC](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425/21 "2020-08-19T14:51:09Z")

</div>

```auto
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

```

[Next page](https://discourse.pi-hole.net/t/cannot-resolve-name-server-after-moving-to-another-network/37425.md?page=2)
