• Raspberry Pi 4 running Raspbian Lite


I already have an IoT Stack comprising of InfluxDB, Telegraf, Mosquitto, Grafana running on the Pi via docker (docker-compose more precisely) and wish to pack the stack behind a reverse-proxy using traefik.

In order to set rules for the Grafana Frontend, I wish to make it available when one hits grafana.mypi4.lan or something similar since I do not have a Domain Name as all the development is for test purposes.

AFAIK mypi4.local is an FQDN under mDNS but something like traefik.mypi4.local or grafana.mypi4.local is not an FQDN.

Is there a way to change the domain name in order to test the reverse-proxy I wish to setup for my Pi?

At Work, we already have our own domain and nameservers in the /etc/resolv.conf

domain workplace.domain.de
nameserver <IP_1>
nameserver <IP_2>

I tried changing the /etc/hosts to mypi4-traefik.workplace.domain.de mypi4-traefik

as well as the hostname of the pi to mypi4-traefik

the pi is reachable via my Windows 10 laptop on the .local domain name but not on mpi4-traefik.workplace.domain.de

  • In my experience you can, but I am not a Windows user. Technically the spec requires this (meaning, mdns is only supposed to work with .local). I think while the linux implementation doesn't enforce it, the one on Windows does.
    – goldilocks
    Oct 14 '20 at 14:23
  • I mean at the end of the day it really doesn't matter if it is windows or not, since whatever will be served is a via a Webbrowser and plus there is WSL if there ever needs to be some form of UNIX-y client.
    – Shan-Desai
    Oct 14 '20 at 14:40
  • If this is for testing, manually associate that domain name with the Pi's LAN address: helpdeskgeek.com/networking/edit-hosts-file (I haven't tried this as again I'm not a user, but it was found instantly via web search for "windows hardcode dns").
    – goldilocks
    Oct 14 '20 at 14:53
  • You changed the resolve.conf on the raspi, right? Then you made the new FQNs visible only for the raspi. It's a local configuration, The Windows laptop has no access to it. The mdns entry (*.local) is not a normal name resolution. It's generated and distributed automatically through a different protocol. I'm not a Windows user, but there is surely a similar "resolve.conf" where you can enter the external IP of the raspi with some FQNs you'd like to access it with. My english is horrible, but I hope you get the idea. By the way is a really strange localhost ;-) Oct 14 '20 at 16:12

Both mypi4.local , traefik.mypi4.local and grafana.mypi4.local is a FQDN (Fully Quallified Domain Name).

See under example, what a FQDN consist of : https://en.wikipedia.org/wiki/Fully_qualified_domain_name

You have to add to either a local DNS server or a host file for traefik.mypi4.local and grafana.mypi4.local to the machine you are testing from.

But I would avoid using .local in the hosfile, just to separate mDNS from local host resolution, so use something else!

Windows hostfile (example: c:\Windows\System32\Drivers\etc\hosts).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.