Re: hostname with DHCP



Finally got some time to work on configuration,
The detailed procedure described by Glenn worked well for
configuring fully qualified host/domain names under DHCP
for Solaris 10 with some minor side effects.
In summary, what I did was:

I'm not a big fan of sys-unconfig since it may reset some
other customization done on the system so I never did that.
This assumes that the DHCP server (in my case a Linksys router
connected to a cable modem using Comcast as ISP)
does not provide a hostname to the client and I want the
hostname to be 'eagle' and my registered domain is 'mydomain.com'
In my system I only have one interface, hme0.

1. Edit /lib/svc/method/net-svc script
Added the domain name where the script writes into the /etc/hosts file.
at lines 140 and 173 as descibed by Glenn in previous post:
echo "${ipaddr}\t${hostname}\t${hostname}.${domain}

2. Configure host/domain name files

cd /etc/
echo > dhcp.hme0
echo "eagle" > nodename
echo "eagle" > hostname.hme0
echo "mydomain.com" > defaultdomain

3. Edit file /etc/default/dhcpagent

Remove request 12 in the last line (PARAM_REQUEST_LIST)
to make sure the client does not ask the DHCP server for
a hostname (in case it would provide a hostname). We are
providing the hostname in file nodename instead. This may not
always be needed.
PARAM_REQUEST_LIST=1,3,6,15,28,43

4. Edit file /etc/auto_home
Change last line, "pdl unknown:/export/home/pdl" to
pdl eagle:/export/home/pdl

This was a side effect of the state of the system when I first
started the system at which time the hostname was assigned 'unknown'.
The DHCP hostname configuration does not work out of the box
in Solaris when the server does not provide a hostname.

This prevented /home/pdl to be mounted on /export/home/pdl
by automountd and gave a lot of confusing error messages
when I tried to log on as user pdl in CDE. It said to look in
many different files and complained about dtsession cookies.
Took some time to figure out what was the problem.
I could log on as root and telnet worked and my home directory
could be accesed through /export/home/pdl but not /home/pdl/

5. Reboot: init 6

-----

After these steps, finally, for the fist time for me for Solaris
under DHCP mode, I got fully qualified host/domain names and
it is automatically configured at boot time.

% /usr/sbin/check-hostname
Hostname eagle OK: fully qualified as eagle.mydomain.com
% uname -a
SunOS eagle 5.10 Generic sun4u sparc SUNW,Ultra-5_10

/etc/hosts now looks like:
127.0.0.1 localhost
192.168.1.100 eagle eagle.mydomain.com # Added by DHCP

Finally, no more error messages in sendmail log files about
unqualified hostnames every time I send an e-mail. Sun
should really think about including an option for this
type of DHCP configuration, which is common, particularly
when using Solaris x86/x64 in home environments now when
Solaris is free and being ported to so many non-Sun
x86 PC's.

One thing I did not configure was loghost.
Don't know if loghost can be the same machine and simply
enetered after localhost in /etc/hosts or if it has to be
a different host or configured differently.

/Karl

.



Relevant Pages

  • Re: hostname with DHCP
    ... > Just rebooted my system and apparently only entering a hostname ... > in /etc/nodename did not seem to work under my DHCP client ... value ends up being used for this interface. ... configuration and get it to install most of the DHCP stuff using its ...
    (comp.unix.solaris)
  • Re: sendmail on a sol9 workstation?
    ... > Managing Mail Delivery by Using an Alternate Configuration ... I have configured two Redhat machines ... However, from my Solaris machine, it appears to come from ... It appears to not realize the correct local hostname instead of localhost. ...
    (comp.unix.solaris)
  • Jumpstart Solaris 8 vs. Solaris 10 (sparc)
    ... With Solaris 8, we've had a process in place for a while now which has ... Trying DHCP on hme0 ... Using DHCP for network configuration information. ... Requesting System Maintenance Mode ...
    (comp.unix.solaris)
  • Re: Solaris 8 - how to permamnently set static ip address instead of DHCP?
    ... Unfortunately it is set to use DHCP, however I want only a static IP address. ... The hostname is by default set to: ... I've searched the Solaris manuals and the Internet, without finding the exact Solaris system admin tools to run to handle the network setup, or which config files to modidy? ... Dave K MCSE. ...
    (comp.unix.solaris)
  • Re: hostname with DHCP
    ... > Windows DHCP server. ... > The Windows administrator doesn't want to put the hostname into the DHCP ... > server or reserve an IP address for the Solaris system. ...
    (comp.unix.solaris)