Welcome, Guest. Please login or register.
Did you miss your activation email?
Pages: [1]   Go Down
  Print  
Author Topic: Domain name to ip  (Read 779 times)
0 Members and 1 Guest are viewing this topic.
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« on: May 05, 2009, 12:27:18 PM »

Code
GeSHi (java):
  1. /*--------------------------------------------------------------------------
  2. UrlToIP.java
  3.  *****************
  4. By: deAppel http://www.engineeringserver.com
  5. Contact: info [@] engineeringserver.com
  6. Version: 05/may/2009
  7. "*****************
  8. Note: shows the IP address that belong to the domain name
  9. //----------------------------------------------------------------------*/
  10. import java.net.InetAddress;
  11. import java.net.UnknownHostException;
  12.  
  13. public class UrlToIP {
  14. public static void main(String[] args){
  15. String hostName ="www.engineeringserver.com";
  16. try {
  17. System.out.println("Url: " + InetAddress.getByName(hostName).getHostName());
  18. System.out.println("IP: " + InetAddress.getByName(hostName).getHostAddress());
  19. } catch (UnknownHostException e) {
  20. e.printStackTrace();
  21. }
  22. }
  23. }
  24.  
Created by GeSHI 1.0.7.20
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here