From owner-freebsd-questions@FreeBSD.ORG Fri Sep 29 11:39:13 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 3A3C416A403 for ; Fri, 29 Sep 2006 11:39:13 +0000 (UTC) (envelope-from nagylzs@enternet.hu) Received: from smtp.enternet.hu (smtp.enternet.hu [62.112.192.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C83D243D55 for ; Fri, 29 Sep 2006 11:39:12 +0000 (GMT) (envelope-from nagylzs@enternet.hu) Received: from [62.112.221.3] (helo=[172.16.0.43]) by smtp.enternet.hu with esmtpa (Exim 4) id 1GTGhz-000Ejr-5A for freebsd-questions@freebsd.org; Fri, 29 Sep 2006 13:39:11 +0200 Message-ID: <451D05DF.2060701@enternet.hu> Date: Fri, 29 Sep 2006 13:39:11 +0200 From: =?ISO-8859-2?Q?Nagy_L=E1szl=F3?= User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Subject: DHCP IP range + auto hostname X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Sep 2006 11:39:13 -0000 Hello, I have a DHCP server with this config file: option domain-name "cassiopeia.ronet"; option domain-name-servers 192.168.0.1; default-lease-time 600; max-lease-time 7200; authoritative; log-facility local7; ddns-update-style none; subnet 192.168.0.0 netmask 255.255.0.0 { range 192.168.0.101 192.168.0.139; option routers 192.168.0.1; use-host-decl-names on; option broadcast-address 192.168.0.255; filename "pxeboot"; option root-path "192.168.0.1:/mnt/d1/rootfs"; } I would like the diskless machines to set their hostname automatically. I have a working named for this. For example: cassiopeia# host diskless131.ronet diskless131.ronet has address 192.168.0.131 cassiopeia# host 192.168.0.131 131.0.168.192.in-addr.arpa domain name pointer diskless131.ronet. cassiopeia# Of course I can create individual hosts in the dhcp config file and set their hostnames. But I do not want to create 40 host declarations and look for the hardware addresses by hand... The clients should be able to determine their hostnames using a reverse dns lookup, and the set their hostnames automatically. In the above example: after the machine got its IP address (192.168.0.131) from the DHCP server, it should set its hostname to 'diskless131.ronet'. Sounds easy, but I do not know how to do that. Is it a standard procedure, or do I need to write a custom script? (Where should I place it?) Thanks, Laszlo