SUMMARY: Solaris 9 DHCP client hostname / DNS Update

From: Randy Millis <>
Date: Wed Jan 07 2004 - 16:27:24 EST
Sorry for the delay writing this Summary:

This *is* in the list archives but I found I had to really dig and piece it
together. maybe its just me. :-)

Here is what worked for me in hopes that it benifits others -  your mileage
may vary.

Create or edit the files outlined and reboot:


inet yourhostname

edit /etc/default/dhcpagent and set


Create this script:

HOSTNAME=`cat /etc/nodename`
echo "Setting hostname to $HOSTNAME... \c"
uname -S $HOSTNAME
        echo "Done."

Symlink /etc/init.d/set_hostname to /etc/rc2.d/S70set_hostname

Thanks to Hichael Morton, Alan Pae, Paul Boven, Sid Wilroy, Gerard Henry,
Dave Miner and Mitchell Bruntel and others who replied and provided
suggestions to me.

Worthy of note:

Dave Miner wrote:

The Solaris DHCP client will not directly send updates to a DNS server;
it's designed to send a requested hostname to the DHCP server (see the
dhcpagent man page for how that's configured), which should update the
DNS on its behalf.  This allows a much more secure DNS configuration, as
the DNS server can be configured to accept updates only from the DHCP
server, rather than any client that happens to connect to the network.

If the network admin can't configure things this way, then your best
fallback right now is to take a look at for a popular
workaround to the hostname being set to "unknown".

Paul Boven Wrote:

I use an 'inproper' way to do it, because Solaris attempts to get its
hostname from the DHCP server, and most DHCP servers won't provide it.

In /etc/init.d/network, line 837, replace the word 'unknown' with
whatever you want your hostname to be. Same goes for
/etc/init.d/inetsvc, line 160. Warning: Sometimes these files might get
replaced by installing patches, and your changes will be lost.

Furthermore, in /etc/default/dhcpagent, you should change the final line
This adds parameters 15,6 and 28 because otherwise the dhcpagent won't
even request those values from the dhcp-server, even though other
startup-scripts do try to get them from dhcp.
15 = domain-name
  6 = DNS-servers
28 = broadcast-address
(See RFC-2132)

Another option would be to set the hostname you want in
/etc/hostname.hme0 (or whatever your interface is called) and then add
'REQUEST_HOSTNAME' to the /etc/default/dhcpagent file, as described in
dhcpagent(1m). I haven't tried this myself though, and I don't know if
this works via dhcp or via dyn-dns.

----- Original Message ----- 
From: "Randy Millis" <>
To: <>
Sent: Wednesday, December 03, 2003 12:29 PM
Subject: Solaris 9 DHCP client hostname / DNS Update

> I've Googled and looked over and so far have not found an
> to this, any help would be appreciated:
> I have a Solaris 9 x86 client requesting an IP via DHCP and it comes up
> the hostname "unknown". As well the Network Admin here tells me I also
> to configure Solaris 9 so it can update the Windows 2000 DNS as they are
> longer using static DNS entries here.
> What is the proper way to set the hostname of my client?
> Has anyone been successful in getting Windows DNS to update from a Solaris
> client and how is this done?
> Thank you
> _______________________________________________
> sunmanagers mailing list
sunmanagers mailing list
Received on Wed Jan 7 16:27:08 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:29 EST