Solved

Setting Host name in Solaris

Posted on 2004-10-27
400 Views
Last Modified: 2013-12-21
I would like to set the hostname to Jack.
I have set the configuration as follow:

# cat nodename
jack
# cat hostname.eri0
jack
# cat hosts
#
# Internet host table
#
127.0.0.1       localhost

192.168.0.3     jack loghost
192.168.0.4     marcel
# hostname jack
# hostname
jack

However, after I reboot the machine, I check hosts again. It will show:
# cat hosts
#
# Internet host table
#
127.0.0.1       localhost

192.168.0.3     unknown loghost
192.168.0.4     marcel
# hostname
unknown

Why? Do i miss anything? What is the reason of hostname changing back to unknown?
0
Question by:matchz
    6 Comments
     
    LVL 34

    Expert Comment

    by:PsiCop
    Use the system un-configuration command --> sys-unconfig

    See --> man sys-unconfig
    0
     
    LVL 38

    Expert Comment

    by:wesly_chen
    Hi,

        For Solaris, there are 6 files need to be changed in order to change hostname.
    /etc/hosts
    /etc/nodename
    /etc/hostname.eri0   <-- interface
    /etc/net/ticlts/hosts
    /etc/net/ticots/hosts
    /etc/net/ticotsord/hosts

       And then reboot.

    Wesly
    0
     
    LVL 2

    Expert Comment

    by:Troxalias
    is there any case that you use DHCP for obtaining your network info (ip address, gateway, hostname etc) ?
    0
     

    Author Comment

    by:matchz
    Yes, I am using DHCP now.
    0
     
    LVL 5

    Expert Comment

    by:ITcrow
    You are assigning a static address while using DHCP.

    Please check the actual IP.
    Since you want a static IP, do not configure your machine for DHCP.

    Most likey, your machine figures out it's name is Jack and then realizes
    according to /etc/hosts this is some other machine. So it has to switch
    to unknown.
    0
     
    LVL 38

    Accepted Solution

    by:
    Hi,

        If you use DHCP, then take out the following line from /etc/hosts
    192.168.0.3     jack loghost   (X)

      and change the following line
    127.0.0.1       localhost ------>    127.0.0.1       localhost jack loghost

        Otherwise, use static IP address.

    Wesly
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
    Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    913 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now