Change Hostname

How to change hostname on Solaris 10?

Questions by frenchbrochier

Showing Answers 1 - 19 of 19 Answers

navnit_05

  • Feb 24th, 2011
 

Change hostname for Global zone

Change the hostname in the following files:

/etc/nodename
/etc/hostname.*interface
/etc/inet/hosts
/etc/inet/ipnodes

and rename directory under /var/crash

# cd /var/crash
# mv oldname newname

then reboot the server.


----------------------------------------------------
Change hostname for Local zone

1. Shut down the zone to be renamed

# zoneadm -z <oldname> halt

2. Modify the configuration files that store the relevant zone configuration

# vi /etc/zones/index

Change all references of <oldname> to <newname> as appropriate

# cd /etc/zones
# mv <oldname>.xml <newname>.xml
# vi <newname>.xml

Change all references of <oldname> to <newname> as appropriate

3. Rename the main zone path for the zone

# cd /export/zones
# mv <oldname> <newname>

Your zone path may be different than the one shown above

4. Modify (network) configuration files of new zone

Depending on the applications installed in your zone, there may be several files you need to update. The essential networking files are:

# cd /export/zones/<newname>/root
# vi etc/hosts
# vi etc/nodename

But others containing your old host/zone name can also be found using this command:

# cd /export/zones/<newname>/root/etc
# find . -type f | xargs grep <oldname>

5. Boot the new zone again

# zoneadm -z <newname> boot

  Was this answer useful?  Yes

satish

  • Jul 28th, 2011
 

#hostname

  Was this answer useful?  Yes

SUBBU

  • Aug 16th, 2011
 

#hostname is temp
for permament we update in /etc/hosts,/etc/nodname,/etc/hostname.

  Was this answer useful?  Yes

ayubkhan

  • Aug 29th, 2011
 

We can change via vi/etc/host

  Was this answer useful?  Yes

Avnish Jain

  • Nov 11th, 2011
 

# hostname

  Was this answer useful?  Yes

vivekmathur

  • Mar 13th, 2012
 

for temp: #hostname
for permanent change :
entry in the following files:
cat /etc/nodename
cat /etc/hosts
cat /etc/inet/ipnodes
cat /etc/hostname.xxx0

  Was this answer useful?  Yes

sridh

  • Mar 27th, 2012
 

If we want change the host name permanently we have to change the entry in 3 files.
Before changing 3 files first type the following command
#hostname ----- here new host name is now we assign the name.
now we have to change in three lines
1. Edit hosts file i.e #vi /etc/hosts wehave to put the new host nae after editing this file
2.Edit nodename file #vi /etc/nodename
3.Edit hostname.xxx here xxx----represent interface name
i.e #vi /etc/hostname.xxx

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions