Results 1 to 4 of 4

Thread: How can i change the hostname on Solaris

  1. #1
    Join Date
    Jun 2009
    Posts
    321

    How can i change the hostname on Solaris

    Hey guys,, i need some urgent help from you all guys.

    I am having a Solaris System which is having some problem with its hostname. The hostname for my machine keeps coming up as "unknown". I need to change it that i don't know how to do. Could you guys please help me out in changing the hostname of my Solaris System ? Help will be appreciated.

  2. #2
    Join Date
    May 2008
    Posts
    4,085

    Re: How can i change the hostname on Solaris

    The files that set hostname and IP address on Solaris are always in /etc,, like Solaris: /etc/inet/hosts. Like this there are 6 files that contain the hostname and you have to edit all these files. They are:

    1. /etc/hosts
    2. /etc/nodename
    3. /etc/hostname.*
    4. /etc/net/ticlts/hosts
    5. /etc/net/ticots/hosts
    6. /etc/net/ticotsord/hosts
    7. /etc/inet/ipnodes


    Once done, just reboot the system. Thats it!!

  3. #3
    Join Date
    Apr 2008
    Posts
    3,267

    Re: How can i change the hostname on Solaris

    To change the hostname on a Solaris system:

    1. Change the hostname in /etc/nodename. Replace the information in this file; commenting out the previous value will cause problems during a reboot.

    2. Run uname -S new_hostname to change the nodename and hostname for your current session.

    3. Change the hostname in /etc/hostname.network_interface (e.g., /etc/hostname.hme0). Replace the information in this file; commenting out the previous value will cause problems during a reboot.

    4. Change the hostname in /etc/hosts

    5. Change the hostname in /etc/net/*/hosts (/etc/net/ticlts/hosts, /etc/net/ticots/hosts, /etc/net/ticotsord/hosts), if applicable.

    Code:
    # for FILE in `find /etc/net -name hosts` ; do
    > fgrep -l old_hostname $FILE > /dev/null 2>&1 && sed 's/old_hostname/new_hostname/g' $FILE > $FILE.new && mv $FILE.new $FILE
    > done
    6. Change the savecore-dir

    Code:
    # [ ! -d /var/crash/`uname -n` ] && mkdir /var/crash/`uname -n` && chmod 700 /var/crash/`uname -n`
    # dumpadm -s /var/crash/`uname -n`
    7. Change the hostname in /etc/inet/ipnodes.
    Source:brandonhutchinson

  4. #4
    Join Date
    Jun 2009
    Posts
    321

    Re: How can i change the hostname on Solaris

    Thanks a lot guys for quick help. Thats is all i needed. I tried the steps and it worked.

    Now its showing my hostname properly. Help appreciated.

Similar Threads

  1. How to hide hostname from router
    By mathis in forum Networking & Security
    Replies: 3
    Last Post: 30-08-2013, 11:49 AM
  2. Change hostname with out fouling up network connection
    By catherine zeta in forum Networking & Security
    Replies: 3
    Last Post: 15-09-2009, 11:59 AM
  3. Can ping IP but not hostname
    By supernoob in forum Networking & Security
    Replies: 3
    Last Post: 29-07-2009, 09:45 PM
  4. Change IP Address on Solaris 10
    By Segvoia in forum Networking & Security
    Replies: 3
    Last Post: 19-06-2009, 03:00 PM
  5. How to get the hostname using JavaScript
    By Ricky58 in forum Software Development
    Replies: 3
    Last Post: 15-05-2009, 09:47 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,457,200.32026 seconds with 16 queries