Name resolution lost when restarting Fritzbox

I've been experiencing the same issue lately.
I remember from when I installed Owncloud on the Pi, that turning off Power Management for the WiFi helped.
Now that I want to do the same thing with the current system, I found that /etc/network/interfaces looks very different, so I don't really know how to do this:

#interfaces(5) file used by ifup(8) and ifdown(8)
#Please note that this file is written to be used with dhcpcd
#For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
#Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

Debug-Token: fy8j40dn5p

Thx for your help.

Depends your WiFi adapter make model:

lsusb

Check parameters for wlan0 (if any):

grep '' /sys/module/$(readlink /sys/class/net/wlan0/device/driver/module | xargs -n 1 basename)/parameters/*

Could try put below line under wlan0 section in the "interfaces" file:

wireless-power off

Thx for looking at this.

I'm using onboard WiFi (RPi3).

pi@raspberrypi:~ $ sudo grep '' /sys/module/$(readlink /sys/class/net/wlan0/device/driver/module | xargs -n 1 basename)/parameters/*
/sys/module/brcmfmac/parameters/debug:0
/sys/module/brcmfmac/parameters/roamoff:1

The thing is, I can't find the wlan0 section in the interfaces file (posted above).

Is power management enabled currently ?

sudo iwconfig

If on, you could try disable it with below one:

sudo iw dev wlan0 set power_save off

And check again with:

sudo iwconfig

If the above works for you, you can make it persistent by adding/modifying a section to the interfaces file like so:

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    post-up iw dev wlan0 set power_save off

Do mind that you have to enter WiFi SSID and password in the "wpa_supplicant.conf" file by adding below section (replace SSID and PASSWORD):

network={
    ssid="SSID"
    psk="PASSWORD"
}

Thx alot, hopefully that worked.

I just had a similar (related?) issue: After a long time in idle, I couldn't ssh the Pi, but still use Pihole DNS, though very slow.
A reboot helped to change everything back to normal.

I'll report tomorrow or the day after if it has occurred again.

That was quick reply :smiley:
Was power management enabled ?
And did the iw command turn it off ?
And did the power management settings survive a reboot ?

:wink:

Yes to both questions.

EDIT: To all three questions, actually.

1 Like

I just had to restart the Fritzbox, and the problem ocurred again:

ssh: connect to host 192.168.178.92 port 22: No route to host

Power management should be disabled. Maybe the Pi doesn't automatically reconnect when the router restarts?

It's odd that although the Pi doesn't show up on the router's local network overview, I can still surf the web, but name resolving takes like 5 seconds.

When in trouble, post results from a ping from PC to Pi-hole,
and ping from PC to router,
and ping from Pi-hole to PC.

Post results from below one on your PC:

nslookup pi.hole

And post results from below one on Pi-hole:

ip link show; ip addr show; ip route show

EDIT: Ohw and when in trouble, what is displayed on Pi-hole with below one ?

sudo iwconfig

No need, I've split your conversation with @nixalsverdrus out to a new topic! Might need to edit the title...

Great, thank you, @PromoFaux! I'll change the title when I'm clear about what exactly is the issue.

On Topic:
I'm not in trouble at the moment. Not sure if you meant that I should only run any of these in that case. Here's what I get now:

pi@raspberrypi:~ $ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enxb827ebbf9bd6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
link/ether b8:27:eb:bf:9b:d6 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000
link/ether b8:27:eb:ea:ce:83 brd ff:ff:ff:ff:ff:ff

pi@raspberrypi:~ $ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enxb827ebbf9bd6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether b8:27:eb:bf:9b:d6 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:ea:ce:83 brd ff:ff:ff:ff:ff:ff
inet 192.168.178.92/24 brd 192.168.178.255 scope global wlan0
valid_lft forever preferred_lft forever
inet6 fe80::5cc8:f41e:77d9:40f3/64 scope link
valid_lft forever preferred_lft forever

pi@raspberrypi:~ $ ip route show
default via 192.168.178.1 dev wlan0 src 192.168.178.92 metric 303
192.168.178.0/24 dev wlan0 proto kernel scope link src 192.168.178.92 metric 303

When in trouble, it could be complicated to get the outputs, because the Pi is running headless. But if necessary I can try to move the Pi to a more suitable position before I get in trouble.

You were suppose to run the commands on the machines I indicated?
Is the "linux-ehou" machine your PC ?

And is 192.168.178.92 the IP address of Pi-hole ?
If so, its very weird you get address 0.0.0.0 returned for the nslookup command.

When in sh.t creek, I am only interested if you can ping indicated machines and want to know wlan status (connected or not) with the iwconfig command.

Yes, linux-ehou is my PC.
Sorry, I'm a bit tired (it's late in Germany), confused my shells... :face_with_raised_eyebrow:

I'll run the latter three commands on the Pi through ssh and edit the above post.

192.168.178.92 is the Pihole. Could the returned address be 0.0.0.0 because I didn't install the graphical web interface (so it doesn't conflict with my NextcloudPi installation)?

Whats in below file ?

/etc/pihole/local.list

interesting...

/etc/pihole/local.list

0.0.0.0 raspberrypi
0.0.0.0 pi.hole

Run below one and choose reconfigure:

pihole -r

And check again:

cat /etc/pihole/local.list

And check again on PC:

nslookup pi.hole

I reconfigured, still the same.

pi@raspberrypi:~ $ cat /etc/pihole/local.list
0.0.0.0 raspberrypi
0.0.0.0 pi.hole

robert@linux-ehou:~> nslookup pi.hole
Server: 192.168.178.92
Address: 192.168.178.92#53
Name: pi.hole
Address: 0.0.0.0

Could you still post results from below one on Pi-hole ?

ip link show; ip addr show; ip route show

I dont know whats going on with the reconfigure option but it should have populated that "local.list" file with proper IP address instead of 0.0.0.0.
You could alter that file manually for time being and put in the proper IP addresses (both entries the same IP!).
Will need to restart dnsmasq to apply:

sudo service dnsmasq restart

Maybe the @Developers know how come you have 0.0.0.0 in that file ?

Here you go:

pi@raspberrypi:~ $ ip link show; ip addr show; ip route show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enxb827ebbf9bd6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
link/ether b8:27:eb:bf:9b:d6 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000
link/ether b8:27:eb:ea:ce:83 brd ff:ff:ff:ff:ff:ff
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enxb827ebbf9bd6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether b8:27:eb:bf:9b:d6 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:ea:ce:83 brd ff:ff:ff:ff:ff:ff
inet 192.168.178.92/24 brd 192.168.178.255 scope global wlan0
valid_lft forever preferred_lft forever
inet6 fe80::5cc8:f41e:77d9:40f3/64 scope link
valid_lft forever preferred_lft forever
default via 192.168.178.1 dev wlan0 src 192.168.178.92 metric 303
192.168.178.0/24 dev wlan0 proto kernel scope link src 192.168.178.92 metric 303

If you didn't install the web interface, then you should have 0.0.0.0 as your IP because there's no web server on the Pi-hole to redirect ads to.