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]
It is sorta covered in the
JavaRanch Style Guide
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)
How to get DNS IP Address
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014