[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DHCP and domain name



Johan Mazel wrote:
> Actually, I got that in /etc/network/interfaces:
> 
> # The primary network interface
> auto eth0
> iface eth0 inet dhcp
> 
[...]
> For the question 3), I wanted to know why the command "hostanme --fqdn"
> returns me: localhost.localdomain.
> I found out that it was the value stored in /etc/hosts.
> But the problem is still there, I don't know why there is this value in
> /etc/hosts and not something like debian.mydomain with mydomain equal to
> the value that the DHCP gave me at the beginning (cf 2)).

Which dhcp client are you using?
With the package dhcp3-client all these settings can be done by the
script /sbin/dhclient-script and hooks in
/etc/dhcp3/dhclient-enter-hooks.d (see man page of dhclient-script).
By setting the variable RUN to yes in the hook named "debug" all
available variables can be displayed (see comments in
/etc/dhcp3/dhclient-enter-hooks.d/debug).
The standard behaviour of the dhclient-script is to change the hostname
only if it was set to "(none)" originally. But, as said, this can be
changed by adding a new function "set_hostname" in a hook-script.
-- 
Regards,
Jörg-Volker.



Reply to: