I have Solaris 8 running on a Sun Ultra 5 with hostname currently set to "Unknown" right now. How do I go about changing the hostname for this box?
what I do is 'sysunconfig' (i think that's it...or sysuncfg or something...or sys-unconfig). This will unconfigure just about everything in your system like you gave it a fresh install and you can rename your host. I'm sure there is an easier way to do it but I don't know what that is.
Mike
~~~~
simanek@uiuc.edu
"It's a Swingline!"
~~~~
Cheat ...
find in /etc/ a file called hostname.<interface>
for example, hostname.hme0 .... hostname.eri0 hostname.qfe1:1
(you get the idea)
edit the file, change it to be your desired name...
next, edit /etc/hosts and make sure that that name you placed in the hostname file is the first name listed for the interface's IP address... reboot... viola!
Hope that helps, it is how I have done it a number of times without problems...
it can be more files ...,best way of altering a host's name, IP address, domain, timezone,etc., has always been "/usr/sbin/sys-unconfig"
This command asks for a new system's configuration consists of hostname, Network Information Service (NIS) domain name,LDAP, timezone,IP address, IP subnet mask, and root password. This command makes sure there are no applications running that get the configuration
changed while they are running (by shutting down the OS), and makes sure the configuration details are changed in all the right places, read man page of sys-unconfig(1M) before proceeding, also check that if there is a /etc/inet/ipnodes file exists and if there is IPv4 ip address entry in that file for new hostname, then that entry should be same as the one in /etc/hosts file.
Another method, which is not recommended by Sun is, changing hostname manually in files:/etc/nodename
/etc/inet/hosts
/etc/hostname.le0 or hostname.hme0 or an equivalent file
/etc/net/ticlts/hosts
/etc/net/ticots/hosts
/etc/net/ticotsord/hosts
/etc/inet/ipnodes (if file exists and if hostname entry exists)
After modifying the above files, reboot the system.
Above two methods can change hostname of system. But for other operations depending on configuration, you may also have to change the information in /etc/inet/ipnodes, DNS files, NIS server entries, application files etc. having hostnames.
Just one point, some systems might have valid reasons for having different hostnames on various nic's, so double check when changing /etc/hostname.hme0 etc..
i.e. You may have hostname1 on /etc/hostname.hme0 and hostname2 on /etc/hostname.qfe0
After running the sys-unconfig, I no longer can ping any computers around me and Internet access is no longer working also. I set the hostname, IP Address, subnet while running sys-unconfig but did not select the name services. I went into /etc afterward and created an entry for the defaultrouter file.
If you don't select any name service on sys-unconfig, you need to configure one for resolving ip address, i.e if you use DNS just edit /etc/resolv.conf and add
Just an addition to Carlos' last statement about rebooting for changes to take affect. You don't have to reboot (though you can).
After creating the /etc/defaultrouter file, try the following command...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.