[6bone] Dynamic DNS

Jeroen Massar jeroen@unfix.org
Fri, 25 Apr 2003 00:17:17 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0039_01C30AC0.08370D10
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

BEGIN, Thomas wrote:

> I'm working on the relationship between IPv6 and DynamicDNS 
> on several OS.

I use the attached (hope it comes through) script in
combination with some tools (yups I can't avoid awk ;)
as described in the beginning of the script to register
the primary (LAN) interface of my laptop whereever I
carry it.

For the rest just follow the documentation on:
http://ops.ietf.org/dns/dynupd/secure-ddns-howto.html

Greets,
 Jeroen

------=_NextPart_000_0039_01C30AC0.08370D10
Content-Type: application/octet-stream;
	name="update.cmd"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="update.cmd"

rem @echo off
rem ##################################################################
rem Windows NT (NT4/2k/2k3) IPv4 & IPv6 Secure DNS Update Script
rem ##################################################################
rem Get the UnxUtils from http://unxutils.sourceforge.net/ and install =
them somewhere
rem Then adjust your path.
rem Get the nsupdate program + libs from ISC (www.isc.org), usually the =
bind9 distro.
rem Then copy over the K*.private & K*.key over for the host to your =
box.
rem Change the config below, et tada ;)

rem ##################################################################
rem Our config
rem ##################################################################
set HOSTNAME=3Dlimbo
set DOMAIN=3Dunfix.org
set KEYFILE=3DC:\Programs\Net\Bind\Klimbo.unfix.org.+157+34970.key
set UNX=3DC:\Programs\Misc\Unix
set NSUPDATE=3DC:\Programs\Net\Bind\nsupdate
set SCRIPT=3Dc:\Programs\Net\Bind\cmd.txt
set INTERFACE=3D3

rem =
######################################################################
rem The Script
rem =
######################################################################
rem Specify a sane DNS Server
rem Done because on NT nsupdate can't find /etc/resolv.conf that easily =
:)
%UNX%\echo -n "server" >%SCRIPT%
ipconfig /all | grep "DNS Servers" | cut -f2 -d: >>%SCRIPT%

rem Delete the old ones
%UNX%\echo "update delete %HOSTNAME%.%DOMAIN% A" >>%SCRIPT%
%UNX%\echo "update delete %HOSTNAME%.%DOMAIN% AAAA" >>%SCRIPT%
%UNX%\echo "update delete %HOSTNAME%.ipv4.%DOMAIN% A" >>%SCRIPT%
%UNX%\echo "update delete %HOSTNAME%.ipv6.%DOMAIN% AAAA" >>%SCRIPT%

rem Add the IPv4 address.
%UNX%\echo -n "update add %HOSTNAME%.%DOMAIN% 360 A" >>%SCRIPT%
ipconfig /all | grep "IP Address" | cut -f2 -d: >>%SCRIPT%
%UNX%\echo -n "update add %HOSTNAME%.ipv4.%DOMAIN% 360 A" >>%SCRIPT%
ipconfig /all | grep "IP Address" | cut -f2 -d: >>%SCRIPT%

rem Add the IPv6 address.
%UNX%\echo -n "update add %HOSTNAME%.%DOMAIN% 360 AAAA " >>%SCRIPT%
ipv6 if %INTERFACE% | grep addrconf | awk "{print $3; }" | cut -f1 -d, =
>>%SCRIPT%
%UNX%\echo -n "update add %HOSTNAME%.ipv6.%DOMAIN% 360 AAAA " >>%SCRIPT%
ipv6 if %INTERFACE% | grep addrconf | awk "{print $3; }" | cut -f1 -d, =
>>%SCRIPT%

rem And send the update
%UNX%\echo "send" >>%SCRIPT%

%NSUPDATE% -k %KEYFILE% %SCRIPT%

------=_NextPart_000_0039_01C30AC0.08370D10--