As part of some work to resolve a kubernetes application deployment.
The particular application i’m working with has hard dependencies on DNS, particularity, A, TXT and SRV records.
For each kubernetes pod that spins up, i need it to register itself into DNS.
Then the other services can discover themselves.
Here is a basic excerpt of enabling DDNs updates on example.com
Install the basics
apt-get install bind bind9utils dnsutils
Forward Lookup Zone
cat > /etc/named/db.example.com.conf <
Reverse Lookup Zone
cat > /etc/named/db.10.1.1.conf <
Named local config (should be included from named.conf)
cat > /etc/named/named.conf.local <
Key file
cat > /etc/named/rndc-key <
Fix any permissions issues and restart the server
chown root:bind /etc/bind/*
chmod g+w /etc/bind
systemctl restart bind9.service
Test the DDNS updates works
(
echo "server 127.0.0.1"
echo "zone example.com"
echo "update delete xyz.example.com A"
echo "update add xyz.example.com 120 A 192.0.2.1"
echo "send"
) | /usr/bin/nsupdate -k "/etc/bind/rndc.key"
Nslookup for good measure
nslookup xyz.example.com 127.0.0.1