
Turn off or suspend BitLocker on Windows 10 and 11, check if it is on, and handle a fleet without losing recovery keys or failing compliance.
Change a Mac hostname in System Settings or Terminal with scutil: ComputerName, LocalHostName and HostName explained, plus renaming a fleet by script.


Content writer, trio.so
To change the hostname on a Mac, open System Settings > General > About and edit the Name field. That sets the computer name. To set all three names from Terminal, run sudo scutil --set ComputerName "NewName", sudo scutil --set LocalHostName "NewName" and sudo scutil --set HostName "NewName". Use no spaces in the last two. Check the result with scutil --get HostName.
A Mac keeps three names, and "hostname" can mean any of them. That is why the name in Finder can differ from the name in Terminal.
| Name | Where you see it | Rules |
|---|---|---|
ComputerName | System Settings > General > About, Finder sidebar, AirDrop, Sharing | Free text. Spaces and capitals are fine. |
LocalHostName | Bonjour, as name.local on the local network | Letters, numbers and hyphens only. Not case sensitive. |
HostName | The shell prompt, hostname command, DNS and command line tools | A fully qualified or plain name. If it is not set, macOS falls back to another source. |
Apple documents the first two in its guides. When you change the computer name in System Settings, macOS also updates the local hostname, replacing spaces with hyphens, so "My Computer" becomes My-Computer.local. If another Mac on the network already uses the name, macOS adds a number to it.
To set the local hostname on its own, go to General > Sharing, click Edit in the Local hostname section at the bottom, enter the new name and click OK. These are the steps on macOS Ventura 13 and later. On older versions the same options sit under System Preferences > Sharing. Source: Apple Support, Change the computer name on Mac.
Terminal changes all three names and works the same on a MacBook, iMac or Mac mini. You need an administrator account.
sudo scutil --set ComputerName "Finance-MBP-01"
sudo scutil --set LocalHostName "Finance-MBP-01"
sudo scutil --set HostName "Finance-MBP-01"
Then flush the DNS cache so the new name is picked up:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Close the Terminal window and open a new one. The prompt reads the name when the shell starts, so an open window keeps showing the old one.
scutil --get ComputerName
scutil --get LocalHostName
scutil --get HostName
hostname
If scutil --get HostName prints HostName: not set, no explicit hostname exists and macOS builds one from other sources. Setting it with the command above fixes that.
HostName is set, the Mac can take a name from DHCP or reverse DNS on the network it joins, so the name changes between the office and home. Set HostName explicitly to stop that.ComputerName. The router and other Macs show LocalHostName. Change all three to the same value.-2. Pick a unique name.A name tells you something only if every Mac follows the same pattern. A few rules that hold up:
For a fleet, use the serial number as the name. This script reads it, sets all three names and flushes the cache. It needs to run as root, so run it with sudo.
#!/bin/bash
serial=$(ioreg -l | awk -F'"' '/IOPlatformSerialNumber/{print $4}')
name="MAC-${serial}"
/usr/sbin/scutil --set ComputerName "$name"
/usr/sbin/scutil --set LocalHostName "$name"
/usr/sbin/scutil --set HostName "$name"
/usr/bin/dscacheutil -flushcache
/usr/bin/killall -HUP mDNSResponder
Test it on one Mac first and confirm with scutil --get afterwards. A serial number contains only letters and numbers, so it is safe for the local hostname.
If you only need a different account name or home folder, that is a separate job: see how to change the user name and home folder on a Mac and how to change the administrator name on a MacBook.
Renaming one Mac takes a minute. Renaming a hundred is a job for a script. trio.so runs scripts on enrolled Macs from the console. A script on macOS runs when you start it. See Apple device management.

trio.so runs scripts on enrolled Macs from the console.
Every organization today needs a solution to automate time-consuming tasks and strengthen security. Without the right tools, manual processes drain resources and leave gaps in protection. trio.so is designed to solve this problem, automating key tasks, boosting security, and ensuring compliance with ease.
Every organization today needs a solution to automate time-consuming tasks and strengthen security. Without the right tools, manual processes drain resources and leave gaps in protection. trio.so is designed to solve this problem, automating key tasks, boosting security, and ensuring compliance with ease.





Have questions? We've got answers. This section covers some of the most commonly asked questions related to this topic.
sudo scutil --set HostName "NewName" in Terminal, then open a new Terminal window.sudo scutil --set ComputerName "NewName", sudo scutil --set LocalHostName "NewName" and sudo scutil --set HostName "NewName". Use only letters, numbers and hyphens in the last two.Related
The related industry news, interviews, technologies, and resources.

Turn off or suspend BitLocker on Windows 10 and 11, check if it is on, and handle a fleet without losing recovery keys or failing compliance.

How to do a HIPAA risk assessment in 8 steps: scope, inventory, threats, scoring and the risk management plan. Free Excel worksheet with 21 starter risks.

To run powershell script on multiple computers reliably, you need to know which method breaks on offline machines, workgroups, and Mac endpoints.

You can stop employees from installing software on Windows using GPO, AppLocker, or MDM. Here's how each method works and which fits your setup.

If you want to know how to block websites on iPhone, this guide covers Screen Time, DNS filtering, and MDM — including where each method breaks down.

If you're learning how to block an app on iPhone for a managed fleet, start here: supervised enrollment is the gate to real MDM enforcement.

Learn how to choose the right MDM solution with 9 essential criteria. Complete guide for evaluating features, security, and vendor capabilities.

Learn how to execute scripts remotely with security in mind. Methods, best practices, and scaling strategies for IT operations.