OpenHAB:8080 - how does this work?

My openhabian computer makes itself available on my lan, not only via its IP address but also via the hostname OpenHAB:8080. Can someone please tell me what mechanism it is using in order to appear as such? I guess it is somehow usurping (or augmenting) the DNS functionality of my router. Or?.

Normal http port is 80. Specifying 8080 is just picking a different network port.
Nothing to do with DNS.

So it’s just resolving to port :8080?

We are mixing things here.

Openhab is available on port 8080 on your machine…if you try to reach it with YOUR IP:8080 it will work as well.

The fact you can reach it also with the host name it’s a DNS matter so maybe your router (who normally is also the DHCP) let you resolve automatically every hostname of every connected device…some routers do it.

Actually it’s mDNS/Zeroconf/Avahi, not DNS.

Thanks for the response. Does this mean that the OpenHAB computer is running this mDNS service, and that it is itself advertising the resolution between its IP address and it’s host name?

The reason why I am asking this is that I do not have a DNS server running on my router, so I was very surprised to see that the hostname resolution was working. Like magic :slight_smile:

I don’t know the internals, but it looks like :wink:

% dns-sd  -B  _services._dns-sd._udp  local.
Timestamp     A/R    Flags  if Domain               Service Type         Instance Name
9:05:26.187  Add        3   8 .                    _tcp.local.          _openhab-server
% dig @ -p 5353 +short _openhab-server

Those statement are inconsistent …so Maybe you should explain more your infrastructure…

Anyway…your openhab machine can surely resolve itself…(you did not specify if you try to reach the URL from the machine itself or another device)…and if it’s also your DNS it will pass the resolution to others.

If you don’t have any dns involved, I would go with @weakfl …it’s mDNS

Not really. My router is not doing DNS itself. It forwards external WAN DNS calls to my ISP. My question is how the LAN DNS resolution of the OpenHab pc host name to its ip address is being done.

Most routers forward the DNS traffic to the provider, but also resolve the hostnames of the clients in the local network to their IP addresses.

You can run the following command on your (Linux) computer and it should ping your computer.

$ ping $(hostname)

If you can’t setup the DNS for the lan part in the router, and the router is also the DHCP, it is likely that it’s sending itself as the lan DNS and forwarding the dns requests to the wan’s …but being also the DHCP it can resolve also the internal hostnames.

At least it’s advertised via mDNS…

% avahi-browse -a
+   eth0 IPv4 openhab                                       _openhab-server._tcp local
+   eth0 IPv4 openHAB                                       _hap._tcp            local

Afaik the host name is transmitted while getting the IP via DHCP, and the dhcp server will change the hosts file (of the router). And the dns forwarder will use the hosts file for resolving, too.

Just to make this clear: to all the people who are talking on this thread about the port number: thanks for your efforts, but my question was not about the port number. And yes, I know what a port number is. So I suggest you all don’t waste any more of your time talking about the port number. This is totally irrelevant to my question.

My question was about how the openhabian pc is publishing the resolution from its IP address to the OpenHAB host name. The only answer that addresses this question is that of @weakfl — so many thanks to you.

1 Like

Hi @Udo_Hartmann, that was one of my thoughts too. But the actual host name in the DHCP process is “openhabian” whereas the name that works in the browser is “openhab”. And I don’t know where that comes from. But I tend to agree with @weakfl that it could be mDNS running on that machine.