Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

hostname and/or Computername not persistent

Mac Mini M1

macOS Ventura 13.2.1


hostname and Computername are set to e.g. "mainframe", but it changes in Terminal to "Mac-mini" (which is the Model-Name).


Why is this so? How can user make the chose name persistent?


I set the name in System Settings > General > About > Name, in System Settings > Sharing > Local hostname where it is displayed correctly.

When setting the name, it is also displayed in Terminal (I also set it via console using "hostname mainframe").

But shortly after, it changes to "Mac-mini"...


Is this a bug or a feature? 😉



P.S. this is not a DNS issue - none of the local Domain Name Servers know the Mini's IP or its hostname.

Mac mini (M1, 2020)

Posted on Mar 15, 2023 7:03 AM

Reply
Question marked as Best reply

Posted on Mar 15, 2023 7:31 AM

The standard shell prompt is configured to do a reverse DNS lookup using your IP address.


If nothing comes back, then the Sharing name is used.


But if a DNS server (most likely your router) replies with a name, then that name is used.


You can try power cycling your home router.


You can ignore it.


You can change how your shell displays your prompt.

Similar questions

5 replies
Question marked as Best reply

Mar 15, 2023 7:31 AM in response to Riesling Trocken

The standard shell prompt is configured to do a reverse DNS lookup using your IP address.


If nothing comes back, then the Sharing name is used.


But if a DNS server (most likely your router) replies with a name, then that name is used.


You can try power cycling your home router.


You can ignore it.


You can change how your shell displays your prompt.

Mar 15, 2023 9:26 AM in response to Riesling Trocken

Riesling Trocken wrote:

Is this a bug or a feature? 😉

I guess it depends on how you look at it. If you want them to be different, then it's a feature. If you want them the same, then it's a bug. There is no shortage of people who will complain either way.


In Ventura, Apple disconnected these two names. If you change the name in System Settings > General > About > Name, then it will change both the computer name and host name. But if you change only System Settings > Sharing > Local hostname, then it will only change the local host name.


Neither of these settings may have anything to do with what is displayed in the Terminal. That is based on your shell configuration. It may default to one or the other.

hostname and/or Computername not persistent

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.