From owner-freebsd-questions@FreeBSD.ORG Fri Jul 25 08:59:23 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 353D337B401 for ; Fri, 25 Jul 2003 08:59:23 -0700 (PDT) Received: from mailhub.yumyumyum.org (dsl092-171-091.wdc1.dsl.speakeasy.net [66.92.171.91]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2103843F75 for ; Fri, 25 Jul 2003 08:59:22 -0700 (PDT) (envelope-from culverk@yumyumyum.org) Received: by mailhub.yumyumyum.org (Postfix, from userid 1001) id 508CF2C1; Fri, 25 Jul 2003 11:58:25 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mailhub.yumyumyum.org (Postfix) with ESMTP id 41F2B27A; Fri, 25 Jul 2003 11:58:25 -0400 (EDT) Date: Fri, 25 Jul 2003 11:58:25 -0400 (EDT) From: Kenneth Culver To: Shawn In-Reply-To: <1059098593.630.13.camel@CPE-65-26-140-154.kc.rr.com> Message-ID: <20030725115740.Y24957@alpha.yumyumyum.org> References: <1059098593.630.13.camel@CPE-65-26-140-154.kc.rr.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-questions@freebsd.org Subject: Re: Dynamic Hostname Assignment X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jul 2003 15:59:23 -0000 > hostname_start() > { > ip=`ifconfig xl0 | grep 'inet ' | awk '{print $2}'` > # Set the host name if it is not already set > # > if [ -z "`hostname -s`" ]; then > if [ $ip ]; then > hostname=`host $ip | awk '{print $5}'` > hostname ${hostname} > echo "Setting hostname: `hostname`." > fi > fi > } > > I then symlinked /etc/rc.d/hostname to > /usr/local/etc/rc.d/001.hostname.sh so that after the network interface > and everything had been brought up it would set my hostname correctly. > I'm sure this is probably an ugly and unnecessary hack, but I could find > no other way to get my hostname to be set properly :] > > I'm quite willing to go debug or rip apart dhclient to figure out why it > isn't grabbing the hostname if someone points me in the right direction. > Any suggestions? > Most likely, dhclient isn't what's setting it on redhat, it's probably a support script in redhat that's doing it. Ken