public static function getHostByAddress($ipAddress) {
        if (!is_string($ipAddress)) throw new IllegalTypeException('Illegal type of parameter $ipAddress: '.gettype($ipAddress));
        if ($ipAddress == '')       throw new InvalidArgumentException('Invalid argument $ipAddress: "'.$ipAddress.'"');

        $result = gethostbyaddr($ipAddress);

        if ($result==='localhost' && !strStartsWith($ipAddress, '127.'))
            $result = $ipAddress;

        return $result;
    }