Saturday, December 18, 2010

How to Fix No hostname when using DHCP in Solaris

Good Morning all, sorry for the late blog you guys just been busy with life and other projects but since things are slowing down for me i just want to write a quick tutorial on how to make sure that your solaris box uses the hostname that you pick when running solaris as a dhcp client.

#######################
#Disclaimer #
#######################

This configuration was what i used to make dhcp client hostname work for me im not saying that this will definitly work for you b/c i dont know you setup so use this tutorial at your own risk :)


Ok with that out of the way lets begin.


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

2 comments:

Cracking Kerberos Service Tickets (TGS) Using Kerberoasting

As of late I've been spending a lot of time researching and learning different techniques when it comes to attacking Active Directory En...