Go Back   The macosxhints Forums > OS X Help Requests > UNIX - Newcomers



Reply
 
Thread Tools Rating: Thread Rating: 6 votes, 5.00 average. Display Modes
Old 07-18-2004, 08:50 AM   #1
Heavy Clevy
Prospect
 
Join Date: Aug 2003
Posts: 6
Change Computer name from the Command Line

Just wanted to know if anyone knew how to change the Os X computer name via the command line instead of the Preference Pane. I am trying to write a script for my company that will change a bunch of things at once after a net install and did not know how to do this step. any help would be great!!

Thanks
Ryan
Heavy Clevy is offline   Reply With Quote
Old 07-18-2004, 01:30 PM   #2
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
Possibly by editing the "HOSTNAME=" field in /etc/hostconfig.
yellow is offline   Reply With Quote
Old 07-18-2004, 01:48 PM   #3
ulrichm
All Star
 
Join Date: Oct 2003
Location: The Netherlands
Posts: 741
Quote:
Originally Posted by Heavy Clevy
Just wanted to know if anyone knew how to change the Os X computer name via the command line instead of the Preference Pane. I am trying to write a script for my company that will change a bunch of things at once after a net install and did not know how to do this step. any help would be great!!

Thanks
Ryan

Code:
HOSTNAME(1)			   BSD General Commands Manual			  HOSTNAME(1)
 
 NAME
 	 hostname - set or print name of current host system
 
 SYNOPSIS
 	 hostname [-s] [name-of-host]
 
 DESCRIPTION
 	 The hostname utility prints the name of the current host.  The super-user
 	 can set the hostname by supplying an argument.
 
 	 Options:
 
 	 -s	Trim off any domain information from the printed name.
 
 SEE ALSO
 	 gethostname(3)
 
 HISTORY
 	 The hostname command appeared in 4.2BSD.
 
 BSD							 April 28, 1995							 BSD
__________________
..::|| Mac-addict since 1991 ||::..
ulrichm is offline   Reply With Quote
Old 07-18-2004, 01:52 PM   #4
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
As of 10.2.6, I could never get hostname to actually work.
It could have been a problem with the particular machine I was working with at the time. I haven't tried it in a long time, but certainly worth a look. Good memory cells, ulrichm!
yellow is offline   Reply With Quote
Old 07-18-2004, 07:28 PM   #5
aixccapt99
Major Leaguer
 
Join Date: Feb 2003
Posts: 263
Also in /etc/hostconfig:
APPLETALK_HOSTNAME="Appletalk Name"

and change that... I think that's the "Computer Name" from the Sharing pane.
aixccapt99 is offline   Reply With Quote
Old 07-19-2004, 03:02 AM   #6
ulrichm
All Star
 
Join Date: Oct 2003
Location: The Netherlands
Posts: 741
Good caling, aixccapt99!
__________________
..::|| Mac-addict since 1991 ||::..
ulrichm is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 07:05 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.