i wrote a code
try
{
InetAddress in = InetAddress.getByName("ubuntu");
System.out.println(in.getHostAddress());
} catch (UnknownHostException ex)
{
ex.printStackTrace();
}
it doesn't work on my Mac,
but the same code returns IP of "ubuntu" machine on Windows.
Is there some problem that the api responds only when the machine is on Domain, my Mac is on network and can communicate to other pc( window or Mac)?
try
{
InetAddress in = InetAddress.getByName("ubuntu");
System.out.println(in.getHostAddress());
} catch (UnknownHostException ex)
{
ex.printStackTrace();
}
it doesn't work on my Mac,
but the same code returns IP of "ubuntu" machine on Windows.
Is there some problem that the api responds only when the machine is on Domain, my Mac is on network and can communicate to other pc( window or Mac)?