From owner-freebsd-hackers Tue Jun 10 18:07:24 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id SAA18138 for hackers-outgoing; Tue, 10 Jun 1997 18:07:24 -0700 (PDT) Received: from awfulhak.demon.co.uk (awfulhak.demon.co.uk [158.152.17.1]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id SAA18130 for ; Tue, 10 Jun 1997 18:07:18 -0700 (PDT) Received: from awfulhak.demon.co.uk (localhost [127.0.0.1]) by awfulhak.demon.co.uk (8.8.5/8.8.5) with ESMTP id BAA18839; Wed, 11 Jun 1997 01:43:50 +0100 (BST) Message-Id: <199706110043.BAA18839@awfulhak.demon.co.uk> X-Mailer: exmh version 1.6.9 8/22/96 To: mnewton cc: hackers Subject: Re: any one tried this In-reply-to: Your message of "Tue, 10 Jun 1997 10:31:03 EDT." <339D6527.7411@newland.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 11 Jun 1997 01:43:50 +0100 From: Brian Somers Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > I have one host that has a dynamic ip address assigned each time its > logs in. I would like to refer to that host by a domain name i.e > xyz.zzz via a dns on another machine. > What i need to do is update the dns on the dns server with the > new ip address every time that pc logs in. > Any body got any code to do this ? It should be trivial. You can pass the pseudo MYADDR variable to a script in linkup: MYADDR: delete all add 0 0 hisaddr ! /usr/local/bin/dnsupdate myhost MYADDR And in /usr/local/bin/dnsupdate: #! /bin/sh host=$1 shift read a b c d <mynet.zone mv mynet.rev mynet.rev.$bak sed "s/.*[ ]$host$/$d.$c.$b.$a. IN PTR $host/" mynet.rev.$bak >mynet.rev You'll need a small awk/perl script to up your serial number and HUP named too. -- Brian , Don't _EVER_ lose your sense of humour....