My application is posting a xml string to external Server(i refer it as cleint hereafter).
We are doing URL posting not IP based, means never bother about which IP the URL points to.
Often we are getting Connection Timed Out Exception When we informed this to the support team in client, they asked us to switch over to other IP I don't know how to implement this, since we always provide the domain name while opening a connection.
Below is the code which I use.
How it is possible to change the IP, when am using domain name to create a connection?
I used nslookup from command prompt, it sure provides 2 IP's for the same domain. Kindly help me. Thanks.
I used nslookup from command prompt, it sure provides 2 IP's for the same domain.
This sounds odd. While there can be multiple host names that resolve to the same IP address, any particular host name can not resolve to more than one IP address (the DNS "A" record). Are you sure that you have the correct host name?
You could also use a library like DNSJava to look up all records for a given host name, and decide how to proceed based on that information.
Ping & DNS - updated with new look and Ping home screen widget