NSupdate from CLI

Henri Hennebert hlh at restart.be
Mon Oct 27 13:35:18 UTC 2008


Roberto de Sousa wrote:
> Hello all,
> Can someone direct me where to go to find out example of how to create a script using nsupdate from CLI to add host to forward and reversing zone of DNS?
> I am new to Unix and just installed my freeBSD box which running apache and BIND last month.
> 
> Any advise or information will be highly appreciated.

In your named.conf you have eg:

         zone "example.com" {
                 type master;
                 file "dynamic/db.example.com";
                 allow-update { key host1.example.com.; };
         };
         key "host1.example.com." {
                 algorithm hmac-md5;
                 secret "XXXX...XXXX==";
         };

and on host1 you use this script:

#!/bin/sh
NSSERVER="xxx.xxx.xxx.xxx"
MYNAME=host1.example.com
MYADDR=$1
/usr/bin/nsupdate -y host1.example.com.:XXXX...XXXX== \
     1>/dev/null 2>&1 <<EOF
server ${NSSERVER}
update delete $MYNAME. A
update add ${MYNAME}. 60 A ${MYADDR}
send
EOF


The key can be generated by

dnssec-keygen -a HMAC-MD5 -b 128 -n ENTITY password

Le line Key: in Kpassword.+157+xxxxxx.private
contains a key witch can be used in place off XXXX...XXXX==

Henri
> 
> Thanks all.
> 
> Roberto
> 
>  
> buka wainhira la hatene, buka atu hatene liu tan 
> 
> abracos 
> 
> 
> 
>       Make the switch to the world&#39;s best email. Get Yahoo!7 Mail! http://au.yahoo.com/y7mail
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"



More information about the freebsd-net mailing list