private static String getWorkstationName() {
        try {
            final InetAddress addr = InetAddress.getLocalHost();
            final String hostName = addr.getHostName();
            // Ensure the hostname is unqualified by removing any domain part
            return stripDotSuffix(hostName);
        } catch (final UnknownHostException e) {
            return "localhost";
        }
    }
Retrieves the workstation name of the computer originating the request.
This method attempts to get the local host name using the InetAddress class.
If it fails to retrieve the host name due to an UnknownHostException, it returns "localhost" as a fallback.

@return The unqualified workstation name as a String.
httpclient5/src/main/java/org/apache/hc/client5/http/auth/NTCredentials.java