Fix: No hostname when using DHCP in Sun Solaris 8/9/10

 


If you are using DHCP to receive IP Address for your Sun Solaris system, you may end up with no hostname assigned to the system. This can be confirmed when there is no hostname at the prompt or if the output for the command “hostname” is as follows:

# hostname
unknown

or the /etc/hosts file has an entry as follows:

# cat /etc/hosts
#
# Internet host table
#
127.0.0.1 localhost
192.168.0.3 unknown # Added by DHCP


This happens when the DHCP server doesn’t provide a hostname for your server. Most of the DHCP Servers or routers acting as a DHCP Server doesn’t provide a hostname and Solaris DHCP agent relies on the DHCP server for its hostname.

To fix this problem, edit the dhcpagent config and set it not to request a Hostname from the DHCP server and then add a hostname to the /etc/hosts & /etc/nodename file.

Edit DHCPAGENT config

[For Solaris 10, this is not required as setting the hostname in /etc/nodename overrides the hostname provided by the DHCP Server. Move onto the next step]

Edit the dhcpagent config file /etc/default/dhcpagent with your favorite editor

# vi /etc/default/dhcpagent

and look for

PARAM_REQUEST_LIST=1,3,6,12,15,28,43

and remove the Parameter “12” from the above to look as follows:

PARAM_REQUEST_LIST=1,3,6,15,28,43

and save the file.

Now, add the hostname to the /etc/nodename & /etc/hosts as follows

# vi /etc/nodename

and add the hostname you want it to have (solarisserver for me)

# cat /etc/nodename
solarisserver

and edit the /etc/hosts file

# vi /etc/hosts

and add the line similar to the following

192.168.0.3 solarisserver loghost

Now,reboot the server and you should be all fine with hostname set for the system.

# init 6

 Posted by admin at 12:15 pm  Tagged with: dhcp, dhcpagent, hostname, hosts, nodename, solaris, sun

 9 Responses to “Fix: No hostname when using DHCP in Sun Solaris 8/9/10”

  1. Hi,
    I tried the steps given in this article.
    But the problem is not completely eliminated.
    I have given the hostname as hpsolaris.
    During startup it says.

    “My unqualified hostname(hpsolaris): Sleeping for retry”

  2. Question: If DHCP gives out a different IP address next week, will the new IP address be propogated to the hosts table, or will I have a new problem???

  3. Great post!

    I tried another tips on another sites and
    nothing worked.
    I tried then these instructions and worked great
    (on a solaris 10 x86).

    Thanks!

  4. Thanks for this! Very simple and easy article to understand.

    I have the same question as Carey Schug (above). Does the /etc/hosts file gets updated with a new IP when the DHCP server gives a new IP to the client?

  5. Nice article, thanks.

  6. Excellent post. I was able to assign a Static IP for my solaris VM, but the hostname was coming up unknown set by the DHCP. Your article helped me fix the problem.

    Thanks!!

  7. Hi, I’m trying to configure a DHCP server, but I can not, presumably the server is already running, because when I run dhcpconfig-Sq is running, but the client does not resolve the IP address, I know how to configure it from scratch, to see which have been my fault, and if I could say that files set up, thanks

  8. great post! worked like charm

  9. Hi,
    I removed the 12 from /etc/default/dhcpagent.
    cat /etc/nodename
    shows
    sonne
    In /etc/hosts
    I changed
    192.168.178.20 unknown # Added by DHCP
    to
    192.168.178.20 sonne loghost

    After rebooting the /etc/hosts file is changed and instead of “sonne” there is
    192.168.178.20 unknow loghost

    What is wrong?
    It would be creat if you could help.
    Kind regards,
    Niklo

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

 
  Configure IPMP Load Balancing & Resilience in Sun Solaris  Control/Modify dhcpagent configuration in Sun Solaris
 © 2010 Sun Solaris System Admin
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值