Actualizacion Dinámica DNS (Bind9)

NOTA TÉCNICA:

Un pequeño ayuda memoria. Estas cosas que no se hacen todos los días, por simple que sean a veces se olvidan.

En Servidor:

En zona primaria
dominio IN NS ns.zamoranelson.cl.

En config Bind


zone "dominio.zamoranelson.cl" {
type master;
allow-transfer {none; };
file "/etc/bind/dynamic/db.dominio.zamoranelson.cl";
update-policy { grant dominio.zamoranelson.cl. name dominio.zamoranelson.cl. A TXT;
};
};

key dominio.zamoranelson.cl. {
algorithm hmac-md5;
secret "ALJOzy7F0BMPvTv0vIWfYyk6C4ELFGwgsJTs75tDa6qsjk7qbDWhKRuR C1YKdPj0BnwB0bKHoJIeuw9M0f5/Lh==";
};

(Key modificada, no pierda el tiempo 😉 )

Base de Datos
$ORIGIN .
$TTL 3600 ; 1 hour
dominio.zamoranelson.cl IN SOA zamoranelson.cl. dominio.zamoranelson.cl. (
2014091403 ; serial
14400 ; refresh (4 hours)
3600 ; retry (1 hour)
604800 ; expire (1 week)
3600 ; minimum (1 hour)
)
NS ns.zamoranelson.cl.
NS secundario.nic.cl.
$ORIGIN dominio.zamoranelson.cl.

EN CLIENTE

cd /root/

CURRENT_IP=`dig myip.opendns.com +short`
TMPFILE=`mktemp /tmp/update-ip-XXXXXX`

cat > $TMPFILE << EOF server ns.zamoranelson.cl zone dominio.zamoranelson.cl update delete dominio.zamoranelson.cl. A update add dominio.zamoranelson.cl. 3600 A $CURRENT_IP send EOF nsupdate -k Kdominio.zamoranelson.cl.+157+42928.private -v $TMPFILE && rm -f $TMPFILE

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x