This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes How to know the DNS name or IP address of server with code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "How to know the DNS name or IP address of server with code?" Watch "How to know the DNS name or IP address of server with code?" New topic
Author

How to know the DNS name or IP address of server with code?

HiBob Chu
Ranch Hand

Joined: Aug 12, 2002
Posts: 86
Hi friends:
When start a client, the DNS name or the IP
address of server is needed. (and I think they are just the hostname for RMI, is it right?), if the server can display it's DNS name or IP address after it start, the testing of client will be convenience.
Is there any method in Java can display the DNS name or IP address of the machine which the application is running on?
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Yes, you can, but my advice would be not to worry about this. You can assume that the assessor knows his own machine names.
- Peter
HiBob Chu
Ranch Hand

Joined: Aug 12, 2002
Posts: 86
OK, thank you.
regards.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to know the DNS name or IP address of server with code?