Raspberry Pi lost internet connection after setup

Expected Behavior:
Raspberry Pi connects to the internet while server is running
Can view http://pi.hole/ for information regarding blocked ads

Actual Behavior:
Raspberry Pi cannot connect to the internet
Cannot reach http://pi.hole/ "ERR_NAME_NOT_RESOLVED"

Debug Token:
None given after running pihole -d, due to non-upload since it cant connect to the internet. If I need to post any part or all of it let me know

Hello and thanks in advance for any advice given. I just got done installing Pi-Hole onto a new raspberry pi. I used netgear's genie to change all of the settings for the Pi to be the DNS used. However, after completing this task, the pi lost connection to the internet and after trying multiple other things from other forums, it still will not properly reconnect to the internet. I'm assuming that the 2nd issue is in result of the internet connection issues. It still says however when I ran pihole status that it is functioning properly and from pihole -v the version is 3.2.1 with the latest being an "ERROR" (again most likely due to the internet issue). If anyone has any ideas, please let me know.

Can you post results from below ones on Pi-hole ?

traceroute 104.24.109.83

cat /etc/resolv.conf

nslookup pi.hole localhost

I'm having the very same issue, and I've done what you've asked:

adblock@raspberrypi:~ $ traceroute 104.24.109.83
traceroute to 104.24.109.83 (104.24.109.83), 30 hops max, 60 byte packets
 1  192.168.0.253 (192.168.0.253)  3159.129 ms !H  3158.971 ms !H  3158.945 ms !H
adblock@raspberrypi:~ $ cat /etc/resolv.conf
# Generated by resolvconf
search home
nameserver 127.0.0.1
adblock@raspberrypi:~ $ nslookup pi.hole localhost
Server:		localhost
Address:	::1#53

Name:	pi.hole
Address: 192.168.1.17

I've set the pi-hole to use 192.168.0.253 (since I have a windows dhcp server on 254). I know that there's a "default gateway" listed as 192.168.1.1, but the entire subnet for all devices are on 192.168.0.1/24. I can ssh into the pi-hole, but I can't access the web interface (except once awkwardly when I tried fiddling with the router from Spectrum).

Run pihole -d for a debug token.

adblock@raspberrypi:~ $ nslookup pi.hole localhost
Server:		localhost
Address:	::1#53

Name:	pi.hole
Address: 192.168.1.17

adblock@raspberrypi:~ $ pihole -d

This process collects information from your Pi-hole, and optionally uploads it to a unique and random directory on tricorder.pi-hole.net.

The intent of this script is to allow users to self-diagnose their installations.  This is accomplished by running tests against our software and providing the user with links to FAQ articles when a problem is detected.  Since we are a small team and Pi-hole has been growing steadily, it is our hope that this will help us spend more time on development.

NOTE: All log files auto-delete after 48 hours and ONLY the Pi-hole developers can access your data via the given token. We have taken these extra steps to secure your data and will work to further reduce any personal information gathered.

*** [ INITIALIZING ]
[i] 2018-06-04:19:15:31 debug log has been initialized.

*** [ INITIALIZING ] Sourcing setup variables
[i] Sourcing /etc/pihole/setupVars.conf...

*** [ DIAGNOSING ]: Core version
[i] Core: v3.3.1 (https://discourse.pi-hole.net/t/how-do-i-update-pi-hole/249)
[i] Branch: master
[i] Commit: v3.3.1-0-gfbee18e

*** [ DIAGNOSING ]: Web version
[i] Web: v3.3 (https://discourse.pi-hole.net/t/how-do-i-update-pi-hole/249)
[i] Branch: master
[i] Commit: v3.3-0-ge48aa29

*** [ DIAGNOSING ]: FTL version
[✓] FTL: v3.0 (https://discourse.pi-hole.net/t/how-do-i-update-pi-hole/249)

*** [ DIAGNOSING ]: dnsmasq version
[i] 2.76

*** [ DIAGNOSING ]: lighttpd version
[i] 1.4.45

*** [ DIAGNOSING ]: php version
[i] 7.0.27

*** [ DIAGNOSING ]: Operating system
[✓] Raspbian GNU/Linux 9 (stretch)

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

*** [ DIAGNOSING ]: Processor
/opt/pihole/piholeDebug.sh: line 474: $'[\E[32m✓\E[0m] \E[32marmv7l\E[0m': command not found

*** [ DIAGNOSING ]: Networking
[✓] IPv4 address(es) bound to the eth0 interface:
   192.168.0.253/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)

[✓] IPv6 address(es) bound to the eth0 interface:
   2605:e000:1313:208b:0:b148:1273:5dc1 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)
   fe80::cf73:42f8:cf8c:fc 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)

   ^ Please note that you may have more than one IP address listed.
   As long as one of them is green, and it matches what is in /etc/pihole/setupVars.conf, there is no need for concern.

   The link to the FAQ is for an issue that sometimes occurs when the IPv6 address changes, which is why we check for it.

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

[i] Default IPv6 gateway: fe80::3c11:64ff:fece:7ea8
   * Pinging fe80::3c11:64ff:fece:7ea8...
[✓] Gateway responded.

*** [ DIAGNOSING ]: Ports in use
[] is in use by 
[22] is in use by sshd
[53] is in use by dnsmasq
[4711] is in use by pihole-FTL

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

*** [ DIAGNOSING ]: Pi-hole processes
[✓] dnsmasq daemon is active
[✗] lighttpd daemon is inactive
[✓] pihole-FTL daemon is active

*** [ DIAGNOSING ]: Setup variables
    PIHOLE_INTERFACE=eth0
    IPV4_ADDRESS=192.168.1.17/24
    IPV6_ADDRESS=
    QUERY_LOGGING=true
    INSTALL_WEB=true
    LIGHTTPD_ENABLED=1
    DNSMASQ_LISTENING=single
    PIHOLE_DNS_1=8.8.8.8
    PIHOLE_DNS_2=8.8.4.4
    PIHOLE_DNS_3=208.67.222.222
    PIHOLE_DNS_4=208.67.220.220
    DNS_FQDN_REQUIRED=true
    DNS_BOGUS_PRIV=true
    DNSSEC=false
    CONDITIONAL_FORWARDING=false

*** [ DIAGNOSING ]: Dashboard and block page
[✗] X-Header does not match or could not be retrieved.

[✗] X-Header does not match or could not be retrieved.


*** [ DIAGNOSING ]: Gravity list
-rw-r--r-- 1 root root 4361359 Jun  4 19:04 /etc/pihole/gravity.list
   -----head of gravity.list------
   192.168.1.17 0.0.0.0
   192.168.1.17 0.r.msn.com
   192.168.1.17 0.start.bz
   192.168.1.17 000.gaysexe.free.fr

   -----tail of gravity.list------
   192.168.1.17 zzsyw.com
   192.168.1.17 zztxdown.com
   192.168.1.17 zzz.clickbank.net
   192.168.1.17 zzzrtrcm2.com

*** [ DIAGNOSING ]: contents of /etc/pihole

-rw-r--r-- 1 root root 633 May  2 18:02 /etc/pihole/adlists.list
   https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
   https://mirror1.malwaredomains.com/files/justdomains
   http://sysctl.org/cameleon/hosts
   https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
   https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
   https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
   https://hosts-file.net/ad_servers.txt

-rw-r--r-- 1 root root 46 Jun  4 19:04 /etc/pihole/local.list
   192.168.1.17 raspberrypi
   192.168.1.17 pi.hole

-rw-r--r-- 1 root root 234 May  2 18:01 /etc/pihole/logrotate
   /var/log/pihole.log {
   	su root root
   	daily
   	copytruncate
   	rotate 5
   	compress
   	delaycompress
   	notifempty
   	nomail
   }
   /var/log/pihole-FTL.log {
   	su root root
   	weekly
   	copytruncate
   	rotate 3
   	compress
   	delaycompress
   	notifempty
   	nomail
   }

*** [ DIAGNOSING ]: contents of /etc/dnsmasq.d

-rw-r--r-- 1 root root 1577 Jun  4 18:20 /etc/dnsmasq.d/01-pihole.conf
   addn-hosts=/etc/pihole/gravity.list
   addn-hosts=/etc/pihole/black.list
   addn-hosts=/etc/pihole/local.list
   localise-queries
   no-resolv
   cache-size=10000
   log-queries=extra
   log-facility=/var/log/pihole.log
   local-ttl=2
   log-async
   server=8.8.8.8
   server=8.8.4.4
   server=208.67.222.222
   server=208.67.220.220
   domain-needed
   bogus-priv
   interface=eth0

*** [ DIAGNOSING ]: contents of /etc/lighttpd

-rw-r--r-- 1 root root 3027 May  2 18:01 /etc/lighttpd/lighttpd.conf
   server.modules = (
   	"mod_access",
   	"mod_accesslog",
   	"mod_auth",
   	"mod_expire",
   	"mod_compress",
   	"mod_redirect",
   	"mod_setenv",
   	"mod_rewrite"
   )
   server.document-root        = "/var/www/html"
   server.error-handler-404    = "pihole/index.php"
   server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
   server.errorlog             = "/var/log/lighttpd/error.log"
   server.pid-file             = "/var/run/lighttpd.pid"
   server.username             = "www-data"
   server.groupname            = "www-data"
   server.port                 = 80
   accesslog.filename          = "/var/log/lighttpd/access.log"
   accesslog.format            = "%{%s}t|%V|%r|%s|%b"
   index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
   url.access-deny             = ( "~", ".inc", ".md", ".yml", ".ini" )
   static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
   compress.cache-dir          = "/var/cache/lighttpd/compress/"
   compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )
   include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
   include_shell "/usr/share/lighttpd/create-mime.assign.pl"
   include_shell "find /etc/lighttpd/conf-enabled -name '*.conf' -a ! -name 'letsencrypt.conf' -printf 'include \"%p\"
' 2>/dev/null"
   $HTTP["url"] =~ "^/admin/" {
       
       setenv.add-response-header = (
           "X-Pi-hole" => "The Pi-hole Web interface is working!",
           "X-Frame-Options" => "DENY"
       )
       $HTTP["url"] =~ ".ttf$" {
           
           setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
       }
   }
   $HTTP["url"] =~ "^/admin/\.(.*)" {
        url.access-deny = ("")
   }
   include_shell "cat external.conf 2>/dev/null"

*** [ DIAGNOSING ]: contents of /etc/cron.d

-rw-r--r-- 1 root root 1495 May  2 18:01 /etc/cron.d/pihole
   8 3   * * 7   root    PATH="$PATH:/usr/local/bin/" pihole updateGravity
   00 00   * * *   root    PATH="$PATH:/usr/local/bin/" pihole flush once quiet
   @reboot root /usr/sbin/logrotate /etc/pihole/logrotate
   */10 *  * * *   root    PATH="$PATH:/usr/local/bin/" pihole updatechecker local
   14 12  * * *   root    PATH="$PATH:/usr/local/bin/" pihole updatechecker remote
   @reboot root    PATH="$PATH:/usr/local/bin/" pihole updatechecker remote reboot

*** [ DIAGNOSING ]: contents of /var/log/lighttpd

-rw-r--r-- 1 www-data www-data 2617 Jun  4 18:37 /var/log/lighttpd/error.log
   2018-05-02 18:00:30: (log.c.217) server started 
   2018-05-02 18:01:58: (server.c.1828) server stopped by UID = 0 PID = 1 
   2018-05-02 18:01:58: (log.c.217) server started 
   2018-05-02 18:01:58: (server.c.1295) WARNING: unknown config-key: alias.url (ignored) 
   2018-05-02 18:04:58: (server.c.1828) server stopped by UID = 0 PID = 1 
   2018-05-02 18:05:18: (log.c.217) server started 
   2018-05-02 18:05:18: (server.c.1295) WARNING: unknown config-key: alias.url (ignored) 
   2018-06-04 14:55:18: (server.c.1828) server stopped by UID = 0 PID = 1 
   2018-06-04 14:55:32: (log.c.217) server started 
   2018-06-04 14:55:32: (server.c.1295) WARNING: unknown config-key: alias.url (ignored) 
   2018-06-04 14:58:12: (server.c.1828) server stopped by UID = 0 PID = 1 
   2018-06-04 14:58:21: (log.c.217) server started 
   2018-06-04 14:58:21: (server.c.1295) WARNING: unknown config-key: alias.url (ignored) 
   2018-06-04 15:31:51: (server.c.1828) server stopped by UID = 0 PID = 1 
   2018-06-04 15:32:08: (log.c.217) server started 
   2018-06-04 15:32:08: (server.c.1295) WARNING: unknown config-key: alias.url (ignored) 
   2018-06-04 15:39:03: (server.c.1828) server stopped by UID = 0 PID = 1 
   2018-06-04 15:39:23: (log.c.217) server started 
   2018-06-04 15:39:23: (server.c.1295) WARNING: unknown config-key: alias.url (ignored) 
   2018-06-04 16:43:28: (server.c.1828) server stopped by UID = 0 PID = 1 
   2018-06-04 16:43:39: (log.c.217) server started 
   2018-06-04 16:43:39: (server.c.1295) WARNING: unknown config-key: alias.url (ignored) 
   2018-06-04 16:43:55: (server.c.1828) server stopped by UID = 0 PID = 1 
   2018-06-04 16:44:13: (log.c.217) server started 
   2018-06-04 16:44:13: (server.c.1295) WARNING: unknown config-key: alias.url (ignored) 

*** [ DIAGNOSING ]: contents of /var/log

-rw-r--r-- 1 pihole pihole 29049 Jun  4 19:04 /var/log/pihole-FTL.log
   [2018-06-04 16:43:09.151] Gravity list entries: 122436
   [2018-06-04 16:43:09.151] No blacklist present
   [2018-06-04 16:43:09.151] No wildcard blocking list present
   [2018-06-04 16:43:09.151] read_data_from_DB() - SQL error prepare (5): database is locked
   [2018-06-04 16:43:09.152] Reading from /var/log/pihole.log (rw-r--r--)
   [2018-06-04 16:43:29.039] NOTICE: Received signal SIGHUP - re-reading gravity files
   [2018-06-04 16:43:29.193] FATAL: FTL received SIGTERM from PID/UID 1/0, exiting gracefully
   [2018-06-04 16:43:29.320] FATAL: FTL received SIGTERM from PID/UID 1845/0, exiting gracefully
   [2018-06-04 16:43:29.463] Gravity list entries: 122436
   [2018-06-04 16:43:29.609] No blacklist present
   [2018-06-04 16:43:29.609] No wildcard blocking list present
   [2018-06-04 16:43:29.610]  -> Total DNS queries: 0
   [2018-06-04 16:43:29.610]  -> Cached DNS queries: 0
   [2018-06-04 16:43:29.610]  -> Forwarded DNS queries: 0
   [2018-06-04 16:43:29.610]  -> Exactly blocked DNS queries: 0
   [2018-06-04 16:43:29.610]  -> Wildcard blocked DNS queries: 0
   [2018-06-04 16:43:29.610]  -> Unknown DNS queries: 0
   [2018-06-04 16:43:29.610]  -> Unique domains: 0
   [2018-06-04 16:43:29.610]  -> Unique clients: 0
   [2018-06-04 16:43:29.610]  -> Known forward destinations: 0
   [2018-06-04 16:43:29.610] Shutting down...
   [2018-06-04 16:43:29.774] Finished final database update
   [2018-06-04 16:43:29.774] 
   [2018-06-04 16:43:36.107] 
   [2018-06-04 16:43:36.115] FTL branch: v3.0

*** [ DIAGNOSING ]: Pi-hole log
-rw-r--r-- 1 dnsmasq root 2988051 Jun  4 19:18 /var/log/pihole.log
   -----head of pihole.log------
   Jun  4 16:43:29 dnsmasq[590]: exiting on receipt of SIGTERM
   Jun  4 16:43:36 dnsmasq[495]: started, version 2.76 cachesize 10000
   Jun  4 16:43:36 dnsmasq[495]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
   Jun  4 16:43:36 dnsmasq[495]: warning: ignoring resolv-file flag because no-resolv is set
   Jun  4 16:43:36 dnsmasq[495]: using nameserver 8.8.4.4#53
   Jun  4 16:43:36 dnsmasq[495]: using nameserver 8.8.8.8#53
   Jun  4 16:43:36 dnsmasq[495]: read /etc/hosts - 5 addresses
   Jun  4 16:43:36 dnsmasq[495]: read /etc/pihole/local.list - 2 addresses
   Jun  4 16:43:36 dnsmasq[495]: failed to load names from /etc/pihole/black.list: No such file or directory
   Jun  4 16:43:40 dnsmasq[495]: read /etc/pihole/gravity.list - 122436 addresses
   Jun  4 16:43:55 dnsmasq[495]: exiting on receipt of SIGTERM
   Jun  4 16:44:13 dnsmasq[524]: started, version 2.76 cachesize 10000
   Jun  4 16:44:13 dnsmasq[524]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
   Jun  4 16:44:13 dnsmasq[524]: warning: ignoring resolv-file flag because no-resolv is set
   Jun  4 16:44:13 dnsmasq[524]: using nameserver 8.8.4.4#53
   Jun  4 16:44:13 dnsmasq[524]: using nameserver 8.8.8.8#53
   Jun  4 16:44:13 dnsmasq[524]: read /etc/hosts - 5 addresses
   Jun  4 16:44:13 dnsmasq[524]: read /etc/pihole/local.list - 2 addresses
   Jun  4 16:44:13 dnsmasq[524]: failed to load names from /etc/pihole/black.list: No such file or directory
   Jun  4 16:44:18 dnsmasq[524]: read /etc/pihole/gravity.list - 122436 addresses


********************************************
********************************************
[✓] ** FINISHED DEBUGGING! **

    * The debug log can be uploaded to tricorder.pi-hole.net for sharing with developers only.
    * For more information, see: https://pi-hole.net/2016/11/07/crack-our-medical-tricorder-win-a-raspberry-pi-3/
    * If available, we'll use openssl to upload the log, otherwise it will fall back to netcat.

[?] Would you like to upload the log? [y/N] y
    * Using openssl for transmission.
[✗]  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-sanitized.log

adblock@raspberrypi:~ $ 

It fails to upload, I verified the "gateway" showing up as a default, even though I configured the gateway (with pihole -r) to 192.168.0.1, it looks like it's still referencing 192.168.1.1.

Some more researching:

lead to the point:


interface eth0
  static ip_address=192.168.1.17/24
  static routers=192.168.1.1
  static domain_name_servers=127.0.0.1
interface eth0
  static ip_address=192.168.0.253/24
  static routers=192.168.0.1
  static domain_name_servers=127.0.0.1


The old original ip's are listed from the first time trying to install the pi-hole. Will remove the old entry and try again.

Reboot after changing those settings.

Also, setupVars.conf still uses the 192.168.1.17 IP address. Did you set it to this in the last pihole -r reconfigure you did?

I set 192.168.0.253 and 192.168.0.1 as the gateway probably about 5 times at this point, looks like some values aren't being reset after reconfiguring.

You can manually modify the file, fix the dhcpcd file, and run pihole -r to repair.

Alright! That pretty much fixed it. Here's the debug key: np7mt9dbsr

I noticed that IPv6 is throwing a hissy fit, should I be worried about it at all?

Did you check the IPv6 box during installation or reconfiguring? If so, then it's no issue because the installer couldn't find a suitable IPv6 address to use (one that wouldn't change). Normally then it also means you don't have an IPv6 internet connection.

I'll have to untick it. I believe I did disable ipv6 for my network (not going to bother setting up dhcp for ipv6 for a while).

You don't have to go through the setup again if you don't want IPv6. Right now your install isn't using it (see that IPV6_ADDRESS is unset)