   Unix, change the name of the computer?
  Hi I've just reinstalled solaris 10, and I some how missed setting the computer's name during the installation.How would I change the computer's name?Thanks   
  Look at the man page for hostnameAlso, the /etc/hosts file maps your hostname to your ip. To if your localhost is foo then foo would be your computers network name...# cat /etc/hosts::1 localhost.andreib.com localhost127.0.0.1localhost.andreib.com localhost192.168.0.2   zig.andreib.com zig192.168.0.2   zig.andreib.com.So check out the manpage for /etc/hosts also.   ;  When I first entered 'hostname' it showed:unknownSo I then set the hostname like so: hostname myunixBut when I restart the server, the hostname reverts back to unknown.Also after setting the hostname I called 'cat hosts' it showed:127.0.0.1  localhost192.168.0.194   unknown # Added by DHCPI'm a little bit confused on what exactly to do.Thanks alot   ;  In order for the hostname you want to be set on bootup, you need to change it in the /etc/hosts file. Also use the hostname command so you don't have to wait for a reboot for your new hostname to take effect. In short, use both (change /etc/hosts and use the hostname command), and it'll work how I think you're expecting it to.   ;  Perhaps Solaris differs from Gentoo Linux in this regard, but I understood that /etc/hosts is only used for host lookup, not to find your hostname upon boot.I have to set /etc/conf.d/hostname (other Linux distros use other files, so I wouldn't be surprised if Solaris used something different).   ;Quote:Original post by johnnyBravoWhen I first entered 'hostname' it showed:unknownSo I then set the hostname like so: hostname myunixBut when I restart the server, the hostname reverts back to unknown.Also after setting the hostname I called 'cat hosts' it showed:127.0.0.1  localhost192.168.0.194   unknown # Added by DHCPI'm a little bit confused on what exactly to do.Thanks alotEdit /etc/hosts and change unknown to myunix. Run hostname myunix as root and you're set.   ;Quote:Original post by Nathan BaumPerhaps Solaris differs from Gentoo Linux in this regard, but I understood that /etc/hosts is only used for host lookup, not to find your hostname upon boot.I have to set /etc/conf.d/hostname (other Linux distros use other files, so I wouldn't be surprised if Solaris used something different).Yeah solaris doesn't have a etc/conf.dQuote:Edit /etc/hosts and change unknown to myunix. Run hostname myunix as root and you're set.The hosts file is read only. Maybe it has something to do with me selecting DHCP in the installation?   ;Quote:Original post by johnnyBravoThe hosts file is read only. Maybe it has something to do with me selecting DHCP in the installation?You have to modify /etc/hosts as root! ;)   ;Quote:Original post by DenizQuote:Original post by johnnyBravoThe hosts file is read only. Maybe it has something to do with me selecting DHCP in the installation?You have to modify /etc/hosts as root! ;)I'm logged in as root.To edit it I used "vi /etc/hosts"but when i goto save it, it gives me a read only message.Thanks   ;  Try a> chmod u+w /etc/hostsas root to set the file write-able for the owner. It probably has the write flag not set. (The syntax is valid for linux; don't know whether it is also valid for solaris, but I assume it to be.)   