MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.85k stars 495 forks source link

Issues downloading/installing via dietpi-software (dnsmasq being disabled?) #1131

Closed samteezy closed 7 years ago

samteezy commented 7 years ago

Creating a bug report/issue:

Hi, I'm new to DietPi as of today - formerly Raspian Lite user. I think I'm seeing an issue in which the use of pi-hole conflicts with dietpi's handling of services out of the box.

Ever since I installed and activated pi-hole I cannot install packages via dietpi-software because, from what I can tell, it can't resolve DNS queries. I think this is because dietpi disables dnsmasq when it starts the install process, and my RPi is the primary DNS server on my LAN. For example, I've been trying to install phpsysinfo, and I get the "unable to install" because the URL "is offline and/or unreachable" error. Similarly, the scripted repo update errors during this process too.

However, after the process completes and the PI reboots, I can wget the package with no issue. I've tried this with multiple packages.

Required Information:

Additional Information (if applicable):

Expected behaviour:

Install should complete.

Actual behaviour:

URL doesn't resolve and package can't complete.

Steps to reproduce:

  1. Install pi-hole. Configure as primary DNS on LAN.
  2. Attempt to install package via dietpi-software.

Did you submit a dietpi-bugreport?

74bfe7cd-1c38-4d8f-9809-d1a8a1c50545-0

Extra details:

None at this time.

k-plan commented 7 years ago

hi, can you please show us the output of:

cat /etc/network/interfaces

and

cat /etc/pihole/setupVars.conf

Pherhaps:

cat /etc/pihole/install.log

and

cat /var/log/pihole.log | more

samteezy commented 7 years ago

Network settings (I'm not using wifi, btw). As you can see my local device IP is also my DNS server.

#/etc/network/interfaces
#Please use DietPi-Config to modify network settings.

# Local
auto lo
iface lo inet loopback

# Ethernet
allow-hotplug eth0
iface eth0 inet static
address 192.168.50.24
netmask 255.255.255.0
gateway 192.168.50.1
dns-nameservers 192.168.50.24

# Wifi
#allow-hotplug wlan0
iface wlan0 inet dhcp
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
wireless-essid Not_Set
wireless-key Not_Set
wireless-mode Managed
wireless-power off
wpa-ssid Not_Set
wpa-psk Not_Set
#dns-nameservers 8.8.8.8 8.8.4.4

Pihole:

cat /etc/pihole/setupVars.conf
WEBPASSWORD=[redacted]
DNSMASQ_LISTENING=single
PIHOLE_DNS_3=2607:5300:60:815b:db25::1
PIHOLE_DNS_4=2601:282:8201:5d00::feed
DNS_FQDN_REQUIRED=true
DNS_BOGUS_PRIV=true
DNSSEC=false
PIHOLE_INTERFACE=eth0
IPV4_ADDRESS=192.168.50.24/24
IPV6_ADDRESS=
PIHOLE_DNS_1=192.95.54.1
PIHOLE_DNS_2=96.90.175.167
QUERY_LOGGING=true
INSTALL_WEB=true
API_EXCLUDE_DOMAINS=
API_EXCLUDE_CLIENTS=
API_QUERY_LOG_SHOW=blockedonly
API_PRIVACY_MODE=false

Nothing standing out in the last two logs you requested, no errors during install. I've also run pihole -r to be sure it wasn't a setup issue.

k-plan commented 7 years ago

As you can see my local device IP is also my DNS server.

address 192.168.50.24 dns-nameservers 192.168.50.24

... and this is the mistake!

Use what ever you like, 8.8.8.8, 8.8.4.4, or DNS Server of your ISP or DNS provided by your default gateway (router for your ISP) (192.168.50.1)

Or if you like this more, the same DNS Server like in Pi-Hole:

PIHOLE_DNS_1=192.95.54.1
PIHOLE_DNS_2=96.90.175.167

Your problem is cause by your device network interface configuration.

samteezy commented 7 years ago

I'm aware of that. In and of itself isn't a problem though... it's how dietpi decides to handle services. If it didn't stop dnsmasq and other services when running an install of an application, then this wouldn't be a concern.

192.168.50.1 is my router. Guess what the primary DNS is on the router... it's the RPi (192.168.50.24). This is exactly how pi-hole is supposed to be used, and has worked perfectly fine for the better part of a year on a normal Raspbian distro.

Why exactly does DietPi need to stop services when installing programs via dietpi-software? Is it possible to easily modify this behavior and simply prevent it from stopping dnsmasq? I could easily install many of these myself via apt-get, but I'm trying to leverage all the features of DietPi since the contributors have clearly put a great deal of time and effort into it. I've attempted to research this here and on the forums without much luck.

Edit: On a rethink I did set a second DNS server (an external one) in the network settings via dietpi-config, but it doesn't seem to make a difference.

samteezy commented 7 years ago

Okay, I think I might know why the changes in my last edit didn't work. I don't have it in front of me but I know that after applying the network setting changes, I noticed an error message in regards to eth0 reconnecting.

After rebooting the device, I don't see that message when changing network settings and everything's working the way I want. I can have the RPi IP set as the primary DNS, but when I disable the services, it can still resolve domains.

Thanks all, and especially Fourdee, as I'm becoming impressed by these applications you've built to make working in the terminal that much easier.