What's new

DNSOMATIC + Multiple AFRAID.ORG DDNS accounts

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

gjf

Senior Member
Hi All.

I have created a custom ddns-start script to update DDNS both for Dnsomatic and five free subdomains in Afraid.org
Unfortunately CNAME usually cannot be used for aliases in free accounts so looks like it's the only way.
Hope someone will find it useful.
Code:
#!/bin/sh
# Update the following variables:
USERNAME=dnsomatic_useranme
PASSWORD=dnsomatic_password
# Do not change this string:
HOSTNAME=all.dnsomatic.com

# Your afraid.org usernames separated by space:
USER="user1.ignorelist.com user2.ignorelist.com user3.strangled.net user4.strangled.net user5.strangled.net"
# Your afraid.org corresponding APIs separated by space:
API="API1 API2 API3 API4 API5"

# Should be no need to modify anything beyond this point
/usr/sbin/curl -k --silent -u "$USERNAME:$PASSWORD" "https://updates.dnsomatic.com/nic/update?hostname=$HOSTNAME&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG&myip=" > /dev/null
FRSTEXIT=$?

SCNDEXIT=0
RES=""
for var in $API ; do
    curl -fs -o /dev/null "https://freedns.afraid.org/dynamic/update.php?${var}"
    TMP=$?
    SCNDEXIT=$(( $SCNDEXIT + $TMP ))
    RES="${RES} ${TMP}"
    done

if [ $FRSTEXIT -eq 0 ] && [ $SCNDEXIT -eq 0 ] ; then
    /sbin/ddns_custom_updated 1
else
  {
  logger $USERNAME in DNSOMATIC EXIT: $FRSTEXIT
  logger $USER in AFRAID.ORG EXITS: $RES
  /sbin/ddns_custom_updated 0
  }
fi
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top