Linux Computer Names not found

Dazed_75 lthielster at gmail.com
Thu Sep 7 13:33:59 MST 2006


Still have not found where in system startup dhclient is loaded (I
think as /sbin/dhclient3 for my system).  But it appears to me that
dhclient parses /etc/dhcp3/dhclient.conf when it starts and perhaps
never again.  Whether there is any way to have
/etc/dhcp3/dhclient.conf utilize anything other than a quoted literal
string in the send host-name line depends on the "recursive-descent
parser built in to dhclient." (dhclient.conf (5)).  I am thinking it
may be possible to change the line to something like "send host-name
"$HOSTNAME" or some variation using uname -n or /etc/hostname but my
guess is you have tried these.

The dhclient apparently then executes dhclient-script for various
events (dhclient-script (8)).  Furthermore, some of those events cause
dhclient-script to run dhclient-enter-hooks or dhclient-exit-hooks.
Apparently the newer method is to process scripts in the
/etc/dhcp3/dhclient-enter-hooks.d/ directory or the
/etc/dhcp3/dhclient-exit-hooks.d/ directory.  It may be that a script
here COULD do an action or set a variable to cause the hostname to be
given to the DHCP server.  I am unsure.  I did turn on the debug
script in that directory and found that apparently the hostname was
not being passed by dhclient to dhclient-script.  NOTE: it is
interesting that there is a samba script here which seemingly could
publish information to a Windows Netbios environment.  It is not doing
so on my system and I am not interested in researching this today.

The IS a set_hostname() funtion in dhclient-script and it is invoked
for BOUND|RENEW|REBIND|REBOOT events but I do not see what it
accomplishes except to [re]set an environment variable.  That may well
be my poor skills at reading scripts.  But it could also be that
dhclient should be using that to pass the client's host-name to the
DHCP server.  I just have not found any documentation saying so.

It just seems so basic that I have a hard time believing this is not
automatic by default.  The only reason I can imagine is that these
scripts also include support for supplying information to update a DNS
server which would NOT be done by default.  Seems like a poor reason
though.  I hope one of you true gurus out there can give us an
understandable lesson on this.

On 9/7/06, Dazed_75 <lthielster at gmail.com> wrote:
> I've been allowing dhclient-script (8), dhclient.conf (5), and dhcpd-options
> (5) to wear ruts in my brain to little avail.  I have not been able to find
> anything that invokes dhclient.script, but the doc seems to indicate you
> should be able to create an /etc/dhclient-enter-hooks script (as well as an
> exit version if desired) where presumably you could do this customization.
>
> Like I said, I have not found anything invoking /etc/dhclient-script, but it
> does exist.  The hooks scripts do not currently exist on my system but a
> directory /etc/dhclient-enter-hooks.d apparently (see another post I just
> did for why I say apparently) does.  The dhclient-script looks to me like it
> would run scripts in that directory if they were there (though my script
> skills are super rusty these days).  In any case, this appears like a road
> to a solution though I do not know if the mechanism is the same for other
> distros.  For that matter, I am not even sure for Ubuntu given that I can't
> yet determine that it actually uses /etc/dhclient-script.
>
>
> On 9/6/06, Mike <stuff at dustsmoke.com> wrote:
> > > On 9/6/06, Mike <stuff at dustsmoke.com> wrote:
> > >> As for getting the name to show up on a dhcp server, (e.g. the linksys)
> > >> if your using the dhcp3 client on linux you just need to add something
> > >> like
> > >> send host-name "computername";
> > >> to your /etc/dhclient.conf or /etc/dhcp3/dhclient.conf
> > >>
> > >>
> > >> This did fix the name showing for the DHCP Client list on the router.
> > >> For
> > > Ubuntu 6.06 it was in /etc/dhcp3/dhclient.conf as you said.  I find it
> > > difficult to believe this in not standard behaviour for a DHCP client.
> I
> > > also find it very ugly that one would have to manually edit that file
> for
> > > each machine in the local net.  Problem solved but there has to be a
> > > better
> > > way.  Thanks Mike!
> > >
> >
> > You would think so wouldn't you? Seems like you 'should' be able to just
> > tell it to send /etc/hostname..... Or it should just do this by default
> > which it doesn't. At one point I saw a script to pull this off in a
> > hackish manner. But I haven't figured out how to get it to do the way it
> > seems like it should work. Personally I have dhcpd and bind setup with a
> > stub zone from my public domain for my local segment. For my static leases
> > assigned by mac it sending the hostname or not doesn't matter, but for the
> > dynamic pool that also has ddns setup on it. This is a problem if the
> > thing doesn't send the hostname. It'll still work just fine without it but
> > an A record doesn't get created in the forward and reverse zones without
> > it.
> >
> > Its not something thats limited to a linksys dhcp feature. It shows up
> > everywhere. I haven't looked too hard but if you figure out how to make it
> > send /etc/hostname or something along those lines... Let me know.
> >
> > -Mike
> >
> > ---------------------------------------------------
> > PLUG-discuss mailing list -
> PLUG-discuss at lists.plug.phoenix.az.us
> > To subscribe, unsubscribe, or to change  you mail settings:
> >
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
> >
>
>
>
> --
> Be who you are and say what you feel, because those who mind don't matter
> and those who matter don't mind.  - Dr. Seuss


-- 
Be who you are and say what you feel, because those who mind don't
matter and those who matter don't mind.  - Dr. Seuss


More information about the PLUG-discuss mailing list