Diagnosing incorrect macOS device names

A macOS device appears in Datto RMM with an unexpected name, such as Mac, a name that doesn't match macOS System Settings, or a name with a domain suffix. This article explains why the name differs and how to correct it.

Problem statement

The Datto RMM macOS Agent reports the system hostname configured on the device to the Datto RMM platform. This issue affects devices that run the Datto RMM macOS Agent on supported macOS operating systems. You might see one or more of the following symptoms:

  • The device appears as Mac instead of the expected computer name.
  • The device name doesn't match the name shown in macOS System Settings.
  • The device displays a fully qualified domain name (FQDN), such as MacBook.local or MacBook.company.com.
  • A hostname change made on the endpoint doesn't appear in Datto RMM.

These symptoms occur because macOS maintains multiple naming attributes, and the name Datto RMM displays might not match the friendly device name that macOS shows. The Datto RMM macOS Agent primarily uses the HostName value when it reports device identity to the platform. Datto RMM reports the hostname exactly as it is configured on the device and doesn't remove domain suffixes. The following table describes the three macOS name values.

Name Description
HostName System and network hostname that the operating system uses and the Datto RMM Agent reports.
LocalHostName Bonjour and local network name.
ComputerName Friendly device name that appears in macOS System Settings.

EXAMPLE  For example, a device with the following values appears in Datto RMM as MacBook01, not Robert's MacBook:
HostName = MacBook01
LocalHostName = MacBook01
ComputerName = Robert's MacBook

The following symptoms are the result of other conditions:

  • Device appears as Mac: The HostName value isn't configured on the endpoint. Datto RMM might report a generic device name even when LocalHostName and ComputerName are valid.
  • Device appears with a .local or domain suffix: The HostName value includes the suffix. For example, HostName = MacBook01.local appears as MacBook01.local, and HostName = MacBook01.company.com appears as MacBook01.company.com.
  • Hostname change doesn't appear: Datto RMM hasn't yet synchronized the new hostname, or another process reverted the change.

Resolution

To resolve this issue, complete the following steps:

  1. On the affected Mac, open Terminal.
  2. Run the following commands to display the current naming values:

    scutil --get HostName
    scutil --get LocalHostName
    scutil --get ComputerName

  3. Compare the returned values with the device name displayed in Datto RMM. If the HostName command returns an error or indicates that HostName isn't set, the device might appear as Mac.
  4. Run the following commands to set all three values to the same short name. Replace MacBook01 with the name you want Datto RMM to display.

    sudo scutil --set HostName MacBook01
    sudo scutil --set LocalHostName MacBook01
    sudo scutil --set ComputerName MacBook01

  5. Run the following commands to verify the changes:

    scutil --get HostName
    scutil --get LocalHostName
    scutil --get ComputerName

  6. Update the device name in Datto RMM by completing one of the following actions:
    • Request a device audit for the device. Refer to Request Audit.
    • Restart the Datto RMM Agent.
    • Reboot the endpoint.

The device name in Datto RMM updates to match the HostName value. If you take no action, the name updates when the device completes its next scheduled audit.

NOTE  Datto RMM doesn't update the device name immediately after a hostname change. Changes made only to ComputerName don't appear in Datto RMM unless you also update HostName.

Tips and tricks

  • Keep HostName, LocalHostName, and ComputerName consistent unless your organization requires otherwise.
  • If the old name remains after you request an audit, restart the agent, or reboot the device, verify that a mobile device management (MDM) policy, directory service, or provisioning script isn't reverting the hostname change.
  • To display a short name in Datto RMM, remove the .local or domain suffix from the HostName value.