Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Mar 2006 16:02:17 +0100
From:      "Frank Behrens" <frank@pinky.sax.de>
To:        freebsd-hackers@freebsd.org
Subject:   [RFE] dhclient(8) should send hostname
Message-ID:  <200603171502.k2HF2IV3086523@pinky.frank-behrens.de>

next in thread | raw e-mail | index | archive | help

--Message-Boundary-31555
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

Hi,

I tried to setup a new FreeBSD 6.1-BETA2 client and enabled in 
sysinstall DHCP configuration for the interface. It was no problem 
and the system runs fine.

But then I was surprised that my nameserver 
FreeBSD 6.1-PRERELEASE-200602270917 with BIND9 and
"Internet Systems Consortium DHCP Server V3.0.3"
did not know the newly connected system, but a simple win98 notebook 
is immediately visible in DNS.

I found that the dhclient does not send a hostname by default to the 
server, so the server does not know the name. Of course you can enter 
a "send host-name "xxx"" in dhclient.conf, but this makes the setup 
more complicated. 

I propose a change, that dhclient sends always the current hostname 
to the server, the value can be overwritten in dhclient.conf. I see 
no negative impact, because the server has always the possibility to 
reject the name and to choose another one. It would simplify the 
setup and lead to the same behaviour as in other (operating) systems.
A possible (I'm sure not the best) solution I appended as attachment. 

If there are no objections from this list I will create a PR, but 
from my earlier experiences a PR without discussion is in many cases 
useless.

Regards,
   Frank
-- 
Frank Behrens, Osterwieck, Germany
PGP-key 0x5B7C47ED on public servers available.


--Message-Boundary-31555
Content-type: Application/Octet-stream; name="dhclienthostname.diff";
	type=Unbekannt
Content-disposition: attachment; filename="dhclienthostname.diff"
Content-transfer-encoding: BASE64

SW5kZXg6IGRoY2xpZW50LmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2RhdGEvZnJlZWJz
ZC9zcmMvc2Jpbi9kaGNsaWVudC9kaGNsaWVudC5jLHYKcmV0cmlldmluZyByZXZpc2lvbiAx
LjYuMi40CmRpZmYgLXUg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vbnNbREhPX0hPU1RfTkFNRV0gPSAmb3B0aW9uX2VsZW1lbnRzW0RIT19IT1NUX05B
TUVdOworCQkJb3B0aW9uc1tESE9fSE9TVF9OQU1FXS0+dmFsdWUgPSBob3N0bmFtZTsKKwkJ
CW9wdGlvbnNbREhPX0hPU1RfTkFNRV0tPmxlbiA9IGxlbjsKKwkJCW9wdGlvbnNbREhPX0hP
U1RfTkFNRV0tPmJ1Zl9zaXplID0gbGVuOworCQkJb3B0aW9uc1tESE9fSE9TVF9OQU1FXS0+
dGltZW91dCA9IDB4RkZGRkZGRkY7CisJCX0KKwl9CiAKIAkvKiBTZXQgdXAgdGhlIG9wdGlv
biBidWZmZXIuLi4gKi8KIAlpcC0+Y2xpZW50LT5wYWNrZXRfbGVuZ3RoID0gY29uc19vcHRp
b25zKE5VTEwsICZpcC0+Y2xpZW50LT5wYWNrZXQsIDAsCg==

--Message-Boundary-31555--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603171502.k2HF2IV3086523>