HOSTNAME from DNS name server

Karl Auer kauer at biplane.com.au
Mon Jun 29 22:38:55 UTC 2009


On Mon, 2009-06-29 at 16:50 +0200, Pieter Donche wrote:
> I tried
> $ sudo vi /etc/dhcp3/dhclient-exit-hooks.d/debug
> and changed RUN to
> RUN="yes"
> then rebooted, but there is no file /tmp/dhclient-script.debug written (?)

I don't know why that is. Maybe there is a config item to run the hooks?

> also a file /etc/dhcp3/dhclient-script does not exist in Ubuntu 9.04 (?)
> nor /sbin/dhclient.script. There is a file /etc/dhclient.conf
> with a line
> #script "/etc/dhcp3/dhclient-script"

If your /etc/resolv.conf fileis being updated with details sent from
your DHCP server, thein either a script (wherever it is) or a hook is
being run. Find it, e,g, with "locate".

> ( .MYDOMAIN being e.g. .denim.gim.org )
> myname=`dig +short -x new_ip_address`
> myhost=`basename $myname .MYDOMAIN`
> hostname $myhost

I don't know, I've never done it :-) But it looks plausible. 

> and these instructions will be executed at every boot??

They'll be executed every time DHCP sets the host address.

> What must new_ip_address be?

The variable name from the debug hook, with a dollar sign in front of
it, so myname=`dig +short -x $new_ip_address`

Sorry, I left the dollar sign out in my first message.

Regards, K.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20090630/15dc3979/attachment.sig>


More information about the ubuntu-users mailing list