Thursday, August 25, 2016

Bind with TSIG Transfer key

As we have configured master slave DNS on my previous link. Lets have replication with TSIG.

Step 1) On system-x
# cd /var/named/chroot/etc
# dnssec-keygen -a HMAC-MD5 -b 128 -n HOST station-x-station-y.

Now two files will be create

# cat  Kstation-x-station-y.+157+01233.private  (copy the key from here)

# cp -p rndc.key transfer.key
# vim transfer.key
key "station-x-station-y." {
        algorithm       hmac-md5;
        secret          "e511iZsuCmKS4BPfBje7hQ==";
};

# vim named.conf


include "/etc/transfer.key";
acl mylan {172.24.40.0/24;};

allow-transfer {key station-x-station-y.; };
        allow-query     { localhost; mylan; any; };
        allow-query-cache { localhost; mylan; any; };

(save)

#  ln -s transfer.key /etc/transfer.key
#service named restart
#named-checkconf named.conf

#scp transfer.key station-y:/var/named/chroot/etc/


# vi domain40.example.com.forward (add one more record)

secret-x.domain40.example.com.  IN A            172.24.40.100

(save)

# /etc/init.d/named restart

On system -y
# chgrp named transfer.key

# vim named.conf

include "/etc/transfer.key";
acl mylan {172.24.40.0/24;};
server 172.24.40.100 {
keys {station-x-station-y.; };
};


# rndc refresh domain40.example.com

# grep -i tsig /var/log/messages --color

# /etc/init.d/named restart

No comments:

Post a Comment

Renew k8s certificates

Check If certificate expires: amikum@~:03:06:54(⎈ |local-cluster:default):sudo kubeadm certs check-expiration CERTIFICATE                EXP...