File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
core/src/main/java/com/microsoft/applicationinsights/common Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,15 @@ public static boolean isNullOrEmpty(String string) {
3333 }
3434
3535 /**
36- * Returns the hostname using {@link InetAddress#getCanonicalHostName ()} on {@link InetAddress#getLocalHost()}.
36+ * Returns the hostname using {@link InetAddress#getHostName ()} on {@link InetAddress#getLocalHost()}.
3737 * If an error is encountered, the error is logged and it returns null.
3838 *
3939 * @return the local hostname, or null
4040 */
4141 public static String getHostName () {
4242 try {
4343 InetAddress addr = InetAddress .getLocalHost ();
44- return addr .getCanonicalHostName ();
44+ return addr .getHostName ();
4545 } catch (UnknownHostException ex ) {
4646 InternalLogger .INSTANCE .warn ("Error resolving hostname:%n%s" , ExceptionUtils .getStackTrace (ex ));
4747 return null ;
You can’t perform that action at this time.
0 commit comments