aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes How to get DNS name and IP Address with Java code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply locked New topic
Author

How to get DNS name and IP Address with Java code

SP Nam
Ranch Hand

Joined: Oct 15, 2003
Posts: 41
How can I get my DNS servername and IPAddress, by just running a java program from command prompt, code help please
Vinod Chandana
Ranch Hand

Joined: Aug 26, 2003
Posts: 59
Try InetAddress.getLocalHost().getHostName() and InetAddress.getLocalHost().getHostAddress(). This will give u both name and the address of the localhost. Hope this helps. If not give me a message.
Vinod.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

I'm closing this thread, as it's a duplicate of this one, where the question has already been answered. Please post followups there.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get DNS name and IP Address with Java code
 
Similar Threads
Server Instructions...
Enum and DNS for VPIM (Voice Profile for Internet Mail)
How to get DNS IP Address
How to make DNS
DNS Verification