I have a very specific HTC Rezound problem for Android, and I hope someone can have a solution.
When using HTC Rezound AND connected to a 4g network, I get an unknown host error message when I try to connect to our servers using HttpURLConnection. The strange thing about this problem is that if the phone is on Wi-Fi or 3G, the connections to the server work fine. The problem is only 4g. I believe the problem is with TTL (Time to Live) servers set to 0 seconds. Unfortunately, changing TTL is not an option, and work is required.
As a test, I hardcoded the IP address of the host name and tried to connect with it, and it worked fine. Hard coding of an IP address is no longer a real solution, as the servers use a load balancer at the horizontal DNS level. I tried to programmatically restore the IP address using InitAddress:
InetAddress inet = InetAddress.getByName(url.getHost()); String ipAddress = inet.getHostAddress();
Fortunately, this workaround also returns an Unknown host exception.
I also tried changing the internal DNS DNS cache using:
System.setProperty("networkaddress.cache.ttl" , "100");
But that didn't work either.
Any other suggestions or solutions are welcome!
Thanks.
source share