What's new

[Merlin] Dual DDNS possible?

  • 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!

brambil

Occasional Visitor
I run AsusWRT Merlin 384.3 on an RT-AC68U, using NO-IP as DDNS.

Is possible add another ddns, I would like to add also duckdns without dismissing no-ip service.
 
Either manually handle it through a custom DDNS script (see the Wiki for details), or look at DNS-o-Matic, which is able to update multiple DDNS services at once.
 
I have a custom script doing 2, one for IPv4 and one for IPv6.
It’s pretty simple to merge 2 examples from the wiki and with a bit of googling if no example exists for your chosen service (assuming you have basic Linux skills)


Sent from my iPhone using Tapatalk
 
@JDB , can you share your script?

So far it looks like there are two limitations for my dual stack ipv4/ipv6 DNS record renewal:

1. inadyn doesn't support ipv6 yet:
https://github.com/troglobit/inadyn/issues/52

2. Google Domains doesn't allow two dynamic DNS records (A and AAAA) for the same hostname:
https://www.reddit.com/r/homelab/comments/7b6jgq/how_do_i_get_one_dns_hostname_to_point_to_an_ipv4/

Once we get past these limitations, I think it will be as easy as adding the parameter : (checkip-command = "/bin/nvram get ipv6_wan_addr") to another provider config in the /jffs/configs/inadyn.conf.add file.
 
Probably the ugliest script ever made. Literally copied/pasted the contents of the dnsomatic and dynv6 scripts into 1!

Update all the variables with the 'your_' prefix in the contents with the info applicable to your DDNS login. Of course this only works with dnsomatic and dynv6!!


Code:
#!/bin/sh -e
 
sleep 60

# Update the following variables:
USERNAME="your_username"
PASSWORD="your_password"
HOSTNAME="your_ipv4_hostname"

# Should be no need to modify anything beyond this point
/usr/sbin/curl -k --silent "https://$USERNAME:$PASSWORD@updates.dnsomatic.com/nic/update?hostname=$HOSTNAME&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG&myip=" > /dev/null
if [ $? -eq 0 ]; then
  /sbin/ddns_custom_updated 1
else
  /sbin/ddns_custom_updated 0
fi
token="your_token"
hostname="your_ipv6_hostname"
device=br0
file=$HOME/.dynv6.addr6
[ -e $file ] && old=`cat $file`

if [ -z "$hostname" -o -z "$token" ]; then
  echo "Usage: token=<your-authentication-token> [netmask=64] $0 your-name.dynv6.net [device]"                                                                                                                                                         
  exit 1
fi

if [ -z "$netmask" ]; then
  netmask=128
fi

if [ -n "$device" ]; then
  device="dev $device"
fi
address=$(ip -6 addr list scope global $device | grep -v " fd" | sed -n 's/.*inet6 \([0-9a-f:]\+\).*/\1/p' | head -n 1)

if [ -e /usr/sbin/curl ]; then
  bin="curl -fsS"
elif [ -e /usr/sbin/wget ]; then
  bin="wget -O-"
else
  echo "neither curl nor wget found"                                                                                                                                                                                                                   
  exit 1
fi

if [ -z "$address" ]; then
  echo "no IPv6 address found"                                                                                                                                                                                                                         
  exit 1
fi

# address with netmask                                                                                                                                                                                                                                 
current=$address/$netmask

if [ "$old" = "$current" ]; then
  echo "IPv6 address unchanged"                                                                                                                                                                                                                         
  exit
fi

# send addresses to dynv6                                                                                                                                                                                                                               
$bin "http://dynv6.com/api/update?hostname=$hostname&ipv6=$current&token=$token"
if [ $? -eq 0 ]; then
  /sbin/ddns_custom_updated 1
else
  /sbin/ddns_custom_updated 0
fi
$bin "http://ipv4.dynv6.com/api/update?hostname=$hostname&ipv4=auto&token=$token"
if [ $? -eq 0 ]; then
  /sbin/ddns_custom_updated 1
else
  /sbin/ddns_custom_updated 0
fi


# save current address                                                                                                                                                                                                                                 
echo $current > $file
 
Thanks for the share!

This would help me jump over the inadyn IPv6 hurdle! If I used your script, I'd be pushing the IPv6 address to a different domain name though (mysite).dynv6.net. For my case, I want to update the same hostname with an A and AAAA record from my dual stack config. I'm still limited by Google Domains. :/

I'll probably just stick with inadyn and use IPv4 for now.

I've subscribed to the GitHub threads for troglobit/inadyn:

https://github.com/troglobit/inadyn/issues/52
https://github.com/troglobit/inadyn/pull/224

and the fork acolomb/inadyn:.

https://github.com/acolomb/inadyn/blob/ipv6-planning/IDEAS-IPv6.md

I wonder who will be first to be fully compatible with IPv4/IPv6 DDNS dual resolution. The small open source hobbyist community, or the corporate giant. Too bad I need both to work...or at least Google Domains with your script.
 
Last edited:
@DigitizedMe Any update on this?

My ISP might go for IPv4 CG-NAT and IPv6 Dynamic setup in few months. So I would need IPv6 DDNS service to access CCTV cameras and remote desktop services.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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