This issue happens because of the way a mac Operating System manages and prioritizes the Computer Name, the Local HostName, and the HostName details when being requested by the HEIMDAL Agent and displayed by the HEIMDAL Dashboard. In order to identify and list an endpoint/device in the HEIMDAL Dashboard, the HEIMDAL Agent collects the following details:
- Hostname (hostname is picked up by the HEIMDAL Agent when parsing the result of hostname -s command line);
- Motherboard serial;
- Motherboard serial 2;
- Disk serial;
If one of the four details above changes, the HEIMDAL Dashboard will list the endpoint/device as a new entry, thus creating a duplicate entry (the older entry remaining with a Last Seen timestamp in the past).
The issue appears when the macOS endpoint does not have a HostName configured, but only a Local HostName (which can often change due to the way the endpoint is connecting to a network). To better understand the way macOS works, you need to understand the following types of details that are used to identify a computer on a local network:
- Computer Name - a user-friendly name given to the device (it is set when installing the OS, can include spaces, commas, apostrophes, and can be changed later without administrator permissions);
- Local HostName - is the Computer’s Name with the suffix .local added (when the Local HostName is not manually configured), and any spaces/commas/apostrophes are replaced with hyphens. It is used to identify the mac device to Bonjour-compatible services (Bonjour Hello). If the Local HostName is manually configured, it bypasses the Computer's Name (until setting another Computer Name);
- HostName - a strict name given to the device (that is NOT set/configured during OS installation that can only be manually set by the system administrator and cannot include spaces, commas, apostrophes) with the highest priority. When the HostName is set, the device is no longer identified in the network by Local HostName or Computer Name).
When the HostName is not set, running the hostname -s command line will display the Local HostName (or Local Network Name). If the Local HostName is not manually configured, the OS will use the Computer Name to generate a Local HostName (for example, if your Computer’s Name is Support macOS, your Local HostName will be Support-macOS.local. Local HostNames aren’t case sensitive, so support-macos.local is the same as Support-macOS.local). If the Local HostName is manually set, it will ignore the Computer's Name.
In order to solve the situation, you have to make sure that your macOS device has a HostName set/configured since a macOS HostName can only be changed by the system administrator and CANNOT be changed by network issues or network-related services.
To set/configure the Computer's Name, the Local HostName, or the HostName, you can use the scutil command line (more info here: https://ss64.com/osx/scutil.html) with sudo permissions.