openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.59k forks source link

[mqtt] DNS name for mqtt server - offline #4405

Closed psyciknz closed 5 years ago

psyciknz commented 5 years ago

Expected Behavior

Setting up an mqtt (2.4) broker connection in paperui, I set the broker name to mqtt.mydomain.com - which resolves locally to 192.168.2.7. But after saving the borker thing is offline. It only works when I use the actual ip/

Steps to Reproduce (for Bugs)

  1. Create broker thing
  2. Set IP/Hostname to dns name of mqtt server
  3. Things is offline

Context

Under mqtt v1 thig configurartion worked. Also pinging mqtt.mydomain.com resolved the correct ip address

Your Environment

hakan42 commented 5 years ago

Try using the DNS name, and restarting OH after reconfiguring. This issue might have something in common with https://github.com/openhab/openhab2-addons/issues/4393

I am using DNS names in my setup successfully.

psyciknz commented 5 years ago

Just tried that, didn't seem to help. Maybe it's a 2.5 thing Could be how I've dont dns running, as the name of the mqtt server isn't the name that I use....as in machine.localdomain is the actual name, but it point mqtt.localdomain at the ip of machine so that if I want to move mosquitto to another machine I only have to update one place, and all devices follow.

wborn commented 5 years ago

I think we can close this here once the next ESH stable is available which containts the fix for #4393. Then if it remains an issue please create an issue for it in the Eclipse SmartHome issue tracker.

davidgraeff commented 5 years ago

As I'm probably using InetAddress.getByName (haven't looked into the code), it would be a java dns resolution error anyway, not an MQTT binding specific problem.

wborn commented 5 years ago

The latest ESH stable with the MQTT bugfixes is integrated. So let's close this issue here. Please use the ESH issue tracker for future MQTT Binding related issues.