Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change solaris workstation name

Status
Not open for further replies.

AmolBrid

Programmer
Mar 25, 2002
5
IN
hi,
someone can help.
I want to change the name of the solaris pc. It is displaying "unknown".

Amol Brid
 
Hi,

You have to cahnge 3 different files.
1. /etc/hosts
2. /etc/nodename
3. /etc/hostname.(interface)

To find out which network interface you are using you ust use the ifconfig -a command and it will print the network information.

Micha

Micha Grunberg
Unix Sys-Admin
 
The safest way is probably to use the sys-unconfig script. Here's a good reference: thread60-382954

Annihilannic.
 
hi mgrun and Annihilannic

Thanks for ur quick repsonses.

mgrun Can u please tell me what changes i have to do in these files. I am using DHCP and i cannot find the file /etc/nodename.

Bye.

Amol Brid.



 
As Annihilannic stated, the easiest way is to run the sys-unconfig script. It will walk you through all the necessary network and node information. You will not destroy any data.
 
RUN sys-unconfig£¬then reset,input your new hostname
 
Hi contec17 and race123,

i have executed sys-unconfig, but the problem is when i select DHCP it doesn't ask me for hostname.

 
Because a hostname is usually associated with an IP address, and DHCP by definition means that the IP address is dynamic, I presume that's normal!

Presumably it needs to be configured on the DHCP server and/or in the client's /etc/hosts file or DNS.

I'm guessing!

Annihilannic.
 
Thanks Annihilannic and all other guys who tried to help me. I think it is becuase i have selected DHCP.

Thanks again.
 
Hi AmolBrid,

Back in Solaris7, in order to use dhcp and get around the system being renamed 'unknown' if your dhcp server did not supply a name, we used to 'comment' or remove the following lines in the /etc/init.d/inetsvc file:

hostname=`/sbin/dhcpinfo Hostname`
if [ -z "$hostname" ]; then
hostname="unknown"
fi
-----------------------------------------------------------
Or, you could just change:
hostname ="unknown"
to
hostname =&quot;<your hostname>&quot;
-----------------------------------------------------------
Then reboot again.

This assumes that you have the proper entries in:
/etc/hosts
/etc/hostname.<interface> (ex: /etc/hostname.hme0)
/etc/nodename

I'm pretty sure this also worked in Solaris 8.

If that doesn't work, try this web site for a diff approach:


Hope this helps...

Pete
 
I've got Solaris 9 (i86 flavour) and found that you have to change the /etc/init.d/network file as this appears to set the hostname first. I did try updating inetsvc but that didn't work.

case &quot;$_INIT_NET_STRATEGY&quot; in
&quot;dhcp&quot;) hostname=&quot;<your hostname>&quot; ;;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top