Internet dns-nameserver issue

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
mshelby
Posts: 1
Joined: Tue Feb 27, 2018 3:32 pm

Internet dns-nameserver issue

Post by mshelby »

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:

Code: Select all

 # 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:

Code: Select all

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

Code: Select all

   
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) 
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: Internet dns-nameserver issue

Post by k-plan »

mshelby wrote: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.
Correct. Have you read , what is written in /etc/resolv.conf !?!

Code: Select all

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

mshelby wrote:And finally, here is what is listed in ethernet network settings through dietpi-config:
Correct.
But you have missed to mention a imported thing. You have installed Pi-Hole .
Isn't it?

Check:

Code: Select all

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.

Code: Select all

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

If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
Post Reply