Internet dns-nameserver issue

Help! I have inadvertently changed some setting on my Pi and now I can’t get internet availability by default at boot.

I can go in and change the nameserver FROM 127.0.0.1 TO 8.8.8.8 in /etc/resolv.conf This does give me internet availability until I reboot, Then the file is overwritten.

[BACKGROUND INFO]

  1. I am accessing my Pi via SSH using another linux laptop running Debian.
  2. I was having trouble with my internet service in general and was using my laptop to diagnose. NOT my Pi.
  3. I was using a terminal window with tabs. One tab I was accessing my Pi via SSH. The other was looking at my laptop/debian system.
    — THIS IS A RECIPE FOR DISASTER! ESPECIALLY IF DONE LATE AT NIGHT! HA, HA! —

So, yes, long story short, I MUST have inadvertently changed something dns related on my DietPi by mistake.
When the Pi rebooted it has no internet availabilty by default. I can get availability by changing the nameserver in resolv.conf manually. This will hold until I reboot. That file is overwritten by another.

I’ve looked up a few "fixes: on the internt, but most have me changing and modifying or creating new files to disallow reslov.conf from being overwritten. Really, I just want the system to operate as it should by default.

So, any thoughts on what I might change (back) to it’s default setting? Ideas on where to look?

Using dietpi-config then choosing the networking settings does show information as it SHOULD be, and my /etc/network/interfaces file looks right. Here is my /etc/network/interfaces file:

 # Local
auto lo
iface lo inet loopback

# Ethernet
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8 8.8.4.4

And here what is contained in my /etc/resolv.conf file:

  nameserver 127.0.0.1

And finally, here is what is listed in ethernet network settings through dietpi-config:

   
Current Details:                                    
                        │  - Mode    = STATIC                                           │                         
                        │  - Ip      = 192.168.0.100                                    │                         
                        │  - Mask    = 255.255.255.0                                    │                         
                        │  - Gateway = 192.168.0.1                                      │                         
                        │  - DNS     = 127.0.0.1                                        │                         
                        │                                                               │                         
                        │        Change Mode    STATIC                                  │                         
                        │        Copy           Copy Current address to Static          │                         
                        │        Static Ip      192.168.0.100                           │                         
                        │        Static Mask    255.255.255.0                           │                         
                        │        Static Gateway 192.168.0.1                             │                         
                        │        Static DNS     8.8.8.8 8.8.4.4                         │                         
                        │        Disable        Disable Ethernet adapter                │                         
                        │        Apply          Save Changes (Restart Networking)

Correct. Have you read , what is written in /etc/resolv.conf !?!

root@DietPi:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1

# DO NOT EDIT THIS FILE BY HAND – YOUR CHANGES WILL BE OVERWRITTEN


Correct.
But you have missed to mention a imported thing. You have installed Pi-Hole .
Isn’t it?

Check:

root@NanoPi-Neo:~# service dnsmasq status
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; disabled)
  Drop-In: /run/systemd/generator/dnsmasq.service.d
           └─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf
   Active: active (running) since Di 2018-02-27 00:17:05 CET; 17h ago
  Process: 2897 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
  Process: 2893 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
  Process: 2891 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
 Main PID: 2896 (dnsmasq)
   CGroup: /system.slice/dnsmasq.service
           └─2896 /usr/sbin/dnsmasq -x /var/run/dnsmasq/dnsmasq.pid -u dnsmasq -r /var/run/dnsmasq/resolv.conf -7 /etc/dn...

Feb 27 00:17:05 NanoPi-Neo dnsmasq[2891]: dnsmasq: Syntaxprüfung OK.
Feb 27 00:17:05 NanoPi-Neo systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.

Is this up and running, something in Pi-Hole is your problem or misconfigured.

root@NanoPi-Neo:~# pihole status
  [✓] DNS service is running
  [✓] Pi-hole blocking is Enabled