Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URL Posting and NSLOOKUP

 
Rajkumar Sathiya
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[color=#444444]
[size=12]
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.
[/size]
[/color]
 
Chinna Eranna
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajkumar Sathiya wrote:
How it is possible to change the IP, when am using domain name to create a connection?


Just replace the domain name with the ip in the url.

You your client is using redundancy, it is possible that there are two ip's to the same domain.
In that case you can use any one ip.

 
Rajkumar Sathiya
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response.
But, if I use IP instead of domain name, will client authentication work?
 
Chinna Eranna
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should work.. because.. your HostNameVerifier is always returning true.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic