How to set the Mac hostname or computer name from the terminal

Autodesk Support

Oct 8, 2023


Products and versions covered


Issue:

The hostname present in the Mac System Preferences is different to the one shown in the terminal.

The following error may also be seen:

Network License Error -96.7.1100

Environment:

macOS X

Solution:

This information can be useful when configuring your workstation remotely through ssh, or when you need to change the fully qualified hostname of the workstation (which can't be done from the UI).

Note: The following procedure is for informational purposes only and is not an Autodesk certified or supported workflow. Should issues arise with this procedure, they will not be addressed by Autodesk Customer Support.

Perform the following tasks to change the workstation hostname using the scutil command.

  1. Open a terminal.
  2. Type the following command to change the primary hostname of your Mac:
    This is your fully qualified hostname, for example myMac.domain.com
sudo scutil --set HostName <new host name>

So for example:

sudo scutil --set HostName flame01.domain.com
  1. Type the following command to change the Bonjour hostname of your Mac:
    This is the name usable on the local network, for example myMac.local.
sudo scutil --set LocalHostName <new host name>

So for example:

sudo scutil --set LocalHostName flame01
  1. Type the following command to change the computer name:
    This is the user-friendly computer name you see in Finder, for example myMac.
sudo scutil --set ComputerName <new name>

So for example:

sudo scutil --set ComputerName flame01
  1. Flush the DNS cache by typing:
    dscacheutil -flushcache

     

  2. Restart Mac.

Other Resources

Type scutil --help for the complete list of parameters.

Products:

Flare; Smoke; Flame; Flame Assist;


Was this information helpful?


Need help? Ask the Autodesk Assistant!

The Assistant can help you find answers or contact an agent.


What level of support do you have?

Different subscription plans provide distinct categories of support. Find out the level of support for your plan.

View levels of support