• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URL Posting and NSLOOKUP

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should work.. because.. your HostNameVerifier is always returning true.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic