I'm developing an android app that is communicating with a local service. And it's quite annoying not being able to use the app when I move from mobile network -> wifi/LAN, because the host lookup is cached and I will have to force a stop of the application and restart it again to have it work.
So I first thought the "issue" was with my application, not being able to re-resolve the host somehow and so I post the question on their official IRC channel for developers. That's where I was told, and I quote:
you should fix your wifi dns, that's how.
instead of using dns tom-foolery, use iptables DNAT.
On my question:
so you mean it is wrong to have a hostname resolve to a local IP address when inside the LAN, and the external IP address when outside?
I got the explicit answer "Yes" from the channel.
The person was unable to help me specifically with m0n0wall but told me that transparent proxying/routing is what I needed.
I must admit that it sounds far more flexible to have services accessible through the external IP even internally rather than having to setup local dns records. But I have been able to cope with this up until now when my android app is actually giving me problems as it come and go between mobile and wifi network.