File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Sockets and Internet Protocols
How to get DNS name and IP Address with Java code
Joined: Oct 15, 2003
Oct 30, 2003 06:01:00
How can I get my DNS servername and IPAddress, by just running a
program from command prompt, code help please
Joined: Aug 26, 2003
Nov 04, 2003 16:11:00
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.
author and iconoclast
Joined: Jul 08, 2003
Nov 04, 2003 16:46:00
I'm closing this thread, as it's a duplicate of
where the question has already been answered. Please post followups there.
[Jess in Action]
I agree. Here's the link:
subject: How to get DNS name and IP Address with Java code
How to make DNS
Enum and DNS for VPIM (Voice Profile for Internet Mail)
iam getting java.rmi.ConnectException
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015