I am using owntracks app for Android for device tracking. I have my private mqtt broker in my home network. Proper ports are forwarded on router side. Everything works perfectly, when I am outside my network. I use dyndns for my dynamic IP resolving. The problem is when my phone is connected to the same network, where broker is located. Then Owntracks app does not connect to mqtt broker.
When I configure the Owntracks app to use IP instead of the dyndns domain, it connects again.
So the issue is probably on router side. I have experience similar issue in other apps.
Did you have the same issue? How did you solve it?
Your router needs to support hairpin Nat or Nat reflection as it’s sometimes called.
When on the same network you’re essentially going OUT to the internet and trying to come back through your domain name. The router sees the traffic as local and unless it supports hairpin Nat, it will fail like it is now.
Why didn’t I think about it… It’s another level of complexity added to my service stack, but there are some other advantages having local DNS. I will add it to my tasks list.
Thank you for suggestions.