[SOLVED] Hostname not working, images not showing

Sagemcom Router (Sagemcom 3686v2)

Three weeks ago everything was working well. From one device I could reach the http://openhabianpi:8080 and for other devices I just used myopenhab.

But two weeks agoI had to put on a “.local” in order to reach the dashboard also from this device: “http://openhabpian.local:8080
I found this solution in a thread here.

One week ago I was not able to reach http://openhabian.local:8080" either and I had to start using the IP-adress.

The biggest problem with this as a lasting solution is that resources are not loaded in HabPanel due to xss-prevention / wrong host name:

vendor.js:195 Refused to load the stylesheet ‘http://openhabianpi.local:8080/static/layouts/example.css’ because it violates the following Content Security Policy directive: “style-src ‘self’ ‘unsafe-inline’”.

What are common reasons for hotname not working and how can I get this working again?

I tried to do a static host name binding from “openhabianpi” to the ip-adress, but this didn’t help. I thought this would be a sure thing solution. Why isn’t it?

What changes did you make to OH or your router two and one week ago?

I cannot think of any changes done either three weeks ago or one week ago.

Any thoughts?

Are all your devices configured to the same local network dns?
Create a fixed IP to your openhab with the alias openhabianpi in your sagemcom router
Assign all your devices to the sagem local network dns and it should work

I edited the etc/hosts-file and (and assigned a static IP to the mac adress for future proofing). Now everything works as it should.

I wish I got it working again by finding the reason for the host-name stopping working, but now I’m content with a work around.