Get current ip address
System.out.println(InetAddress.getLocalHost());
Get the IP address corresponding to the domain name
InetAddress.getByName("www.baidu.com").getHostAddress();
Get current ip address
System.out.println(InetAddress.getLocalHost());
Get the IP address corresponding to the domain name
InetAddress.getByName("www.baidu.com").getHostAddress();