From owner-freebsd-net@FreeBSD.ORG Tue Oct 24 15:26:16 2006 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF74C16A415; Tue, 24 Oct 2006 15:26:16 +0000 (UTC) (envelope-from joe@joeholden.co.uk) Received: from claire.ber.rewt.org.uk (claire.ber.rewt.org.uk [217.160.200.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 31A3B43D4C; Tue, 24 Oct 2006 15:26:15 +0000 (GMT) (envelope-from joe@joeholden.co.uk) Received: from localhost (localhost [127.0.0.1]) by claire.ber.rewt.org.uk (Postfix) with ESMTP id A0E131400343; Tue, 24 Oct 2006 16:26:14 +0100 (BST) X-Virus-Scanned: Scanned at claire.ber.rewt.org.uk Received: from claire.ber.rewt.org.uk ([127.0.0.1]) by localhost (claire.ber.rewt.org.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nAgLJXxYxZ-2; Tue, 24 Oct 2006 16:26:05 +0100 (BST) Received: from [82.152.108.189] (dyn189.stf.rewt.org.uk [82.152.108.189]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: joe) by claire.ber.rewt.org.uk (Postfix) with ESMTP id 2FD0E1400358; Tue, 24 Oct 2006 16:26:05 +0100 (BST) Message-ID: <453E3085.7040003@joeholden.co.uk> Date: Tue, 24 Oct 2006 16:25:57 +0100 From: Joe Holden User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: Brooks Davis References: <453C0E42.4010604@joeholden.co.uk> <453C5386.5080102@FreeBSD.org> <453C5979.4050408@yandex.ru> <453D35AB.3000908@joeholden.co.uk> <20061024091523.G45134@knop-beagle.kn.op.dlr.de> <20061024143940.GA52335@lor.one-eyed-alien.net> In-Reply-To: <20061024143940.GA52335@lor.one-eyed-alien.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Doug Barton , "Andrey V. Elsukov" , Harti Brandt , net@freebsd.org Subject: Re: Instructing dhclient to set hostname of client X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: joe@joeholden.co.uk List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Oct 2006 15:26:17 -0000 Brooks Davis wrote: > On Tue, Oct 24, 2006 at 09:16:07AM +0200, Harti Brandt wrote: >> On Mon, 23 Oct 2006, Joe Holden wrote: >> >> JH>Andrey V. Elsukov wrote: >> JH>> Doug Barton wrote: >> JH>>> If you're talking about a laptop where you're not sure what the DHCP >> JH>>> server is going to send you, then I have this in /etc/rc.local: >> JH>> >> JH>> Hi, Doug. >> JH>> >> JH>> What you think about adding a new feature to dhclient - Alternate IP >> JH>> Configuration. This configuration can be specified in dhclient.conf >> JH>> and take effect when a DHCP server not respond. MS Windows have a >> JH>> similar feature. >> JH>> >> JH>Really I was hoping dhclient would have this sort of functionality where >> JH>it would resolve the ip given and set that as hostname, as as far as im >> JH>aware, isc-dhcpd will not send hostnames? >> >> Sure it does. On my machines I set hostname to "" in rc.conf and let >> dhclient set it. Works fine. > > Once upon a time I implemented some code to add a default_hostname > variable to rc.conf which was then used by the startup scripts and > dhclient-script to allow the local network to override the name if > desired while insuring that the system had a name at all times (required > for laptop use). I'd take patches to do this. > > -- Brooks > > P.S. hacking this into rc.local won't work longterm because addresses > will be assigned in a totally different context. I wrote an rc.d script called updatehost that does this, its called after other net scripts, and basically gets the ip from $interface (set by updatehost_flags="blah0" in rc.conf, and resolves that, seems to work, a dirty hack but it does the trick. Thanks, Joe