Local Hostname.local

Joined
Dec 4, 2011
Messages
3
Reaction score
0
Points
1
Hi all,

My computer has a local hostame of BlahBlah.local and I can alter this name, if desired, in the Sharing window of System Preferences. But I'm curious about where this name is actually stored or located. The \h or \H flags know where to get it for use in modifying PS1 but I don't see it listed in my .profile or in my default_env_vars file. Thanks in advance for any enlightenment
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
Change you system name under System Preferences > Sharing > Local Hostname
 
OP
J
Joined
Dec 4, 2011
Messages
3
Reaction score
0
Points
1
Thanks Dysfunction; I know about changing the name within the GUI but I'm curious to know which particular Unix file that name is stored in. Some people have suggested it's in /etc/smb.conf but I checked there and didn't see it. Obviously, it's no big deal; I'm just curious about the file location of that variable.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
Well, here's the deal. You'd actually need to use scutil to change the name. Like many Unix's there's a db that actually contains many of the OS's parameters. So, to do so at a CLI (successfully) you'd need to do the following:


scutil –set HostName new_hostname

man scutil <-- for more information
 
OP
J
Joined
Dec 4, 2011
Messages
3
Reaction score
0
Points
1
Thanks Dysfunction! I wondered if it was perhaps stored in such a fashion.I'd never heard of the scutil command before. One of the really amazing characteristics of UNIX is that, unlike most operating systems, so many of the operating parameter files are actually written as text; that's why I was looking for that parameter as an entry in a text file somewhere. Thanks again
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top