From owner-freebsd-questions@FreeBSD.ORG Thu Jul 24 20:33:38 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 A1C0E37B401 for ; Thu, 24 Jul 2003 20:33:38 -0700 (PDT) Received: from out006.verizon.net (out006pub.verizon.net [206.46.170.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D43943FA3 for ; Thu, 24 Jul 2003 20:33:37 -0700 (PDT) (envelope-from mike@pcmedx.com) Received: from duron.pcmedx.com ([4.46.1.67]) by out006.verizon.net (InterMail vM.5.01.05.33 201-253-122-126-133-20030313) with ESMTP id <20030725033336.ZWSX16647.out006.verizon.net@duron.pcmedx.com>; Thu, 24 Jul 2003 22:33:36 -0500 Received: from mike (mike.pcmedx.com [192.168.240.244]) by duron.pcmedx.com (Postfix) with SMTP id 626EDA9A5; Thu, 24 Jul 2003 20:33:36 -0700 (PDT) Message-ID: <000601c3525d$8bb64400$f4f0a8c0@pcmedx.com> From: "Mike Maltese" To: References: <1059098593.630.13.camel@CPE-65-26-140-154.kc.rr.com> Date: Thu, 24 Jul 2003 20:33:42 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Authentication-Info: Submitted using SMTP AUTH at out006.verizon.net from [4.46.1.67] at Thu, 24 Jul 2003 22:33:36 -0500 cc: Shawn 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 03:33:38 -0000 If I understand your question correctly, the following line in /etc/dhclient.conf should do what you want: send host-name "yourhostname"; ----- Original Message ----- From: "Shawn" To: Sent: Thursday, July 24, 2003 7:03 PM Subject: Dynamic Hostname Assignment > When I recently installed and setup FreeBSD 5.1 on my box here at home, > I noticed that it didn't dynamically set the hostname for me. When I > used RedHat Linux 9 before it did. > > I was puzzled by this at first, since RedHat and FreeBSD both use > dhclient (AFAIK), and I spent a few hours looking around for settings > for dhclient and found some information about require-hostname, and a > few other things. But, no matter what I tried, it didn't seem to work. I > continued to look for various articles about dynamic hostname > configuration and I am fairly certain I covered the relevant portions of > the handbook. Everything I've read seemed to indicate it should "just > work", but it wasn't. > > Finally, after I couldn't find an answer anywhere, I devised my own > little hack. I modified /etc/rc.d/hostname like so: > > 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? > > -- > Shawn > http://drevil.warpcore.org/ > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"