I need to get 127.0.0.1 in Windows 'behind' corp DNS. The code I use is:
import java.net.InetAddress;
class IPAddressExample {
public static void main(String args[]) throws Exception {
InetAddress inetAddress = InetAddress.getLocalHost();
System.out.println("IP Address:- " + inetAddress.getHostAddress());
System.out.println("Host Name:- " + inetAddress.getHostName());
}
}
In Linux works and show me 127.0.0.1, but in Windows shows the IP Provided by DHCP. I need it because some test check that.