DNS entries changing Raspberry Pi 4 and FRITZ!Box v7590


lately I discovered a some strange behavior with the DNS of my openHAB installation.
After some time of running the system is not reachable using the hostname, but it works using the IP address. After rebooting the Raspberry Pi everything is fine for a while.

FRITZ!Box 7590
Firmware = 07.20

Release = Raspbian GNU/Linux 10 (buster)
Kernel = Linux 5.4.51-v7l+
Platform = Raspberry Pi 4 Model B Rev 1.1
Memory = Free: 2.75GB (73%), Used: 1.03GB (27%), Total: 3.78GB
Root = Free: 23.48GB (85%), Used: 4.01GB (15%), Total: 28.99GB
Updates = 0 apt updates available.

openHAB 2.5.7-1 (Release Build)

OpenJDK Runtime Environment (Zulu (build 1.8.0_262-b17)
OpenJDK Client VM (Zulu (build 25.262-b17, mixed mode)

After rebooting the Raspberry Pi I get the following information looking up the IP address:
> nslookup

Address:		name = MYRASPPI.fritz.box.		name = MYRASPPI-fritz-box.fritz.box.

Actually I have no idea where the entry MYRASPPI-fritz-box comes from. I can not find it anywhere and I am quite sure, that I did not enter it anywhere like that.

Looking up the IP address later will result in:
> nslookup

Address:		name = MYRASPPI.fritz.box.		name = MYRASPPI-fritz-box.fritz.box.		name = JmDNS-/192-168-1-10.fritz.box.

Everything is still working in this state.

If I look up the IP address, when the system is not reachable by hostname anymore it will result:
> nslookup

Address:		name = MYRASPPI-fritz-box.fritz.box.

I understand, why I am not able to reach the system by hostname now, but why do the entries change during runtime?

During setup of the openHAB I set the Hostname to MYRASPPI.

In the FRITZ!Box router I bind the Raspberry Pi (by MAC address I think) to the name MYRASPPI and the IP address

Rebooting the Raspberry Pi makes everything working again for a couple of hours.

I discovered the problem a few weeks ago.
It might be related to an update of the system, but I can’t say for sure, since I usually update every time , I am applying changes to the system.
It is not related to the latest Firmwareupdate of the FRITZ!Box, since I discovered the problem already with the 07.12 Firmware.
I do not discover anything similar withe any other of my network devices.

Does anyone discover something similar?
Does anyone has an idea how to find and solve the problem?

seems to be related to this: https://github.com/openhab/openhab-core/issues/1472

Hello @Wolfgang_S,

that looks like it and explains some of the behavior.
Actually I still do not understand why this overrides the configuration in my FRITZ!Box router.

1 Like

Same problem same router:

I added wins to hosts entry in the file /etc/nsswitch.conf of the pi and now the fritz box shows the hostname openhab instead of JmDns-/aso (I did not change the hostname in the fritz box UI, so it is sure the pi told it to the fritz box) Maybe the fritz box needs wins in additional to dns. Now it takes some days (mostly) to check if it keeps the hostname of the pi or if it loose it again.

Edit: Does not work :frowning:



Same here. I don’t understand why nslookup of my Raspberry hostname xxxxx-xx triggers from:

** server can’t find xxxx-xxx: NXDOMAIN


Name: xxxx-xxx.fritz.box
Address: 192.168.178.xy
Name: xxxx-xxx.fritz.box
Address: xyz::xyz:xyz:xyz:xyz

The problem is that I can’t access the UI by using the dns name, but it works when using the IP.

I have RasPi, a fritzbox 7590 on v7.50 and now OH 3.4. I had the same with OH version 3.3, so not related to OH I guess.

As long as the IP is correct it always should work. Using the hostname in the browser is just the "human interface"as it is easier for humans to remember names than numbers. The computer in the background translates the naem to the related ip ( as long as it also will be shown by nslookup … ).

Which OS do you use on the computer where your browser runs ?

I’ve noticed the same issues with my Fritzbox 7590 and FritzOS 7.50. After some time local DNS entries are lost. I spent several days trying to investigate and fix this without success. I’ve stopped digging deeper after I found users having similar issues after the FritzBox update. Since I use PiHole, I set a fixed DNS entry for my openHAB instance (setting a fixed one in the FritzBox itself lead to the same problem) and use that one currently.

It must be that! I hadn’t this issue before, but it started after I’ve upgraded to FritzOS 7.50. It is driving me mad since it is happening randomly without an apparent reason. I’ve checked the /etc/dhcpcd.conf entries on my Raspberry Pi, played around with it and tried different settings but no solutions. After few minutes or hours I just had a NXDOMAIN from the nslookup command.
I have also a fixed entry on my FritzBox for the OpenHAB instance, but I had that also before. Now, for the last 8h the nslookup seems to resolve it to the right DNS name… let’s see if it stays like this.
So, not really related to OpenHAB.

That fits into what I’ve observed as well. Originally I planned to update to 7.50 to be able to access openHAB on the go with the new Wireguard function and for that I needed to use the hostname assigned by the FritzBox. “openhab.local”, which I used all the time previously, is not resolved when connected via VPN, so I started to use just “openhab” which then had the issues you also described. The big issue for me here was that I didn’t really know if the “plain” hostname worked well before or not as I always used the “.local” one. Weirdly enough resolving the “.local” hostname failed after the update as well after some time. AFAIK the “.local” hostnames are resolved with MDNS and I thought that I bypass the FritzBox DNS by that anyway. Seems like that wasn’t the case or I missed something but I’m also not too deep into such network topics.
I even tried to rename the host where openHAB is running on. It runs within a Docker container and the container had the same hostname as the host system. That was something I also suspected would be wrong but changing the hostname of the host and in the FritzBox then caused the same effects again. So it’s not something specific to my setup or openHAB.
I hope it works for you to have a fixed hostname in the FritzBox.

I also had many problems with name resolution on openhabian. I finally removed avahi and since then (~
a year) it’s OK.

I had the same issue for a longer time with openHABian and a Fritz!box router trying several “fixes” and workarounds - finally it looks that simply disabling IPv6 in openHABian solved the issue:

For disabling IPv6 just add the following line to /etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 1

and execute

sudo sysctl -p

to activate the new settings.