Skip to content

Instantly share code, notes, and snippets.

@blackvvine
Last active April 6, 2020 01:10
Show Gist options
  • Save blackvvine/f76fbabca98f8324d0376ca75506378f to your computer and use it in GitHub Desktop.
Save blackvvine/f76fbabca98f8324d0376ca75506378f to your computer and use it in GitHub Desktop.
public class CheckHostResolution {
public static void main(String[] args) {
try {
String s = InetAddress.getLocalHost().getCanonicalHostName();
System.out.println(s);
} catch (Exception ex) {
System.err.println(ex);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment