Tag: DDNS

Namecheap DDNS Updates via DD-WRT

DD-WRT has limit support for different DDNS update mechanisms.
A simple workaround is the following script.

Login to your router and go to Administration > Commands

Add the following to the startup script, modifying it for your details

cat < /tmp/namecheap.sh
KEY="YOUR NAME CHEAP DIRTY LONG KEY"
DDNS_DOMAIN="feeditout.com"
DDNS_HOST="dave-pc"
IP=\$(curl ifconfig.co)

curl -s -o temp.html "http://dynamicdns.park-your-domain.com/update?domain=\$DDNS_DOMAIN&password=\$KEY&host=\$DDNS_HOST&ip=\$IP"
EOF

chmod +x /tmp/namecheap.sh
/tmp/namecheap.sh

Finally, go to the Administration > Management and add a crontab to update it hourly.

0 */1 * * * /tmp/namecheap.sh

Enjoy 😉


BIND9 with DDNS updates on Debian Sid

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