Check :

  scutil —get HostName

If a name has been set, that will be used over any derived from the network 
(DHCP/BOOTP, reverse IP query, …).  To set/clear, you would use :

  [sudo] scutil —set HostName <new name>                (use “" to remove the 
persistent name)

- Allan


> On Jan 4, 2017, at 2:50 AM, Andreas Fink <[email protected]> wrote:
> 
> Can anyone shed light on where the hostname is set/stored in macOS Sierra?
> 
> I have a very weird situation where I installed a new mac by restoring a 
> timemachine backup of my previous mac. The hostname keeps coming back from 
> the old mac, despite the new name being set with the hostname command or with 
> the "Sharing" preference pane.
> 
> The previous install was running OS X server, the current one can not even 
> start server (so Its currently removed and trashed even). ( see radar 
> 29845651 as well)
> 
> One thing I noticed is
> 
> a) system boots with "old" name.
> b) i set new name with "hostname new-name"
> c) hostname returns new name.
> d) I open Sharing pref pane. It shows new-name with domain. I change it to 
> new name without the domain
> e) hostname now returns "old" name.
> 
> So the old hostname is coming back form the dead and I can't figure out where 
> its even stored.
> 
> 
> Andreas Fink
> 
> Fink Telecom Services, Rackbone.ch <http://rackbone.ch/>, Cajutel.com 
> <http://cajutel.com/>
> ------------------------------------------------------------------------------
> E-Mail: [email protected] <mailto:[email protected]> www.fink-telecom.com 
> <http://www.fink-telecom.com/> www.rackbone.ch <http://www.rackbone.ch/> 
> www.cajutel.com <http://www.cajutel.com/>
> Mobile: +41-78-6677333 Skype: andreasfink Jabber/XMPP: [email protected] 
> <mailto:[email protected]>
> ------------------------------------------------------------------------------
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Macnetworkprog mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/macnetworkprog/ajn%40apple.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to