DuckDNS dynamic DNS update cient

DuckDNS is free service that fills in the gap left by DynDNS and No-IP's change in business model.

Check out https://duckdns.org/faqs.jsp

The flow is enhanced with code from Paul Reed's No-IP update client http://flows.nodered.org/flow/0bec4c91340ed18154be

[{"id":"a34035d4.5cbfc8","type":"inject","name":"Every 30 minutes","topic":"","payload":"","payloadType":"none","repeat":"1800","crontab":"","once":true,"x":339,"y":30,"z":"f810b109.07ef5","wires":[["83464437.7cb9b8"]]},{"id":"e06ab7d2.1f9548","type":"http request","name":"Update DuckDNS","method":"GET","url":"https://www.duckdns.org/update?domains=**YOUR DOMAIN**&token=**YOUR TOKEN**&ip=","x":403,"y":216,"z":"f810b109.07ef5","wires":[["38e88442.c7177c"]]},{"id":"38e88442.c7177c","type":"switch","name":"Was update sucessful?","property":"payload","rules":[{"t":"eq","v":"OK"},{"t":"neq","v":"OK"}],"checkall":"true","outputs":2,"x":388,"y":279,"z":"f810b109.07ef5","wires":[["78932790.876cd8"],["efc4308c.103bd","b78d5573.4872a8"]]},{"id":"ae6e141.f5191e8","type":"delay","name":"One notification/day","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","rateUnits":"day","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":406,"y":424,"z":"f810b109.07ef5","wires":[["fb043e44.04fbc"]]},{"id":"fb043e44.04fbc","type":"pushbullet","title":"DuckDNS update failed","name":"DuckDNS update failed","x":396,"y":474,"z":"f810b109.07ef5","wires":[]},{"id":"3b8d48f5.c472b8","type":"comment","name":"No","info":"","x":419,"y":318,"z":"f810b109.07ef5","wires":[]},{"id":"f16adf9d.0e952","type":"comment","name":"Yes?","info":"","x":579,"y":256,"z":"f810b109.07ef5","wires":[]},{"id":"efc4308c.103bd","type":"debug","name":"","active":false,"console":false,"complete":false,"x":661,"y":325,"z":"f810b109.07ef5","wires":[]},{"id":"78932790.876cd8","type":"function","name":"Reset fail counter","func":"\ncontext.duckdnsfails=0;\nreturn msg;","outputs":"0","x":695,"y":283,"z":"f810b109.07ef5","wires":[]},{"id":"b78d5573.4872a8","type":"function","name":"Increment fail counter, check if >5","func":"duckdnsfails = context.duckdnsfails || 0;\nduckdnsfails++;\ncontext.duckdnsfails = duckdnsfails;\n\n//Fsiled to update 5+ times?\nif(duckdnsfails <=6) {\n\treturn [msg,null];\n}\nelse {\n    //shout out last known IP\n    msg.payload=context.lastip;\n\treturn [null,msg];\n}","outputs":"2","x":359,"y":375,"z":"f810b109.07ef5","wires":[[],["ae6e141.f5191e8"]]},{"id":"dd239510.22dc68","type":"function","name":"Compare IP","func":"context.lastip = context.lastip || 'initial';\nvar currentip = msg.payload;\n\nif (context.lastip == 'initial') {\ncontext.lastip = currentip;\n}\nelse if (context.lastip != currentip) {\nmsg.payload = currentip;\ncontext.lastip = currentip;\nreturn msg;\n}\n\n","outputs":"1","x":221,"y":214.5,"z":"f810b109.07ef5","wires":[["e06ab7d2.1f9548"]]},{"id":"83464437.7cb9b8","type":"exec","command":"wget -qO- http://bot.whatismyipaddress.com/ ; echo","append":"","useSpawn":"","name":"Call IP - whatismyipaddress.com","x":287,"y":83.5,"z":"f810b109.07ef5","wires":[["652e3ea5.9ad1c"],[],[]]},{"id":"652e3ea5.9ad1c","type":"switch","name":"Integrity check","property":"payload","rules":[{"t":"regex","v":"\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b"},{"t":"else"}],"checkall":"true","outputs":2,"x":341,"y":135.5,"z":"f810b109.07ef5","wires":[["dd239510.22dc68"],[]]}]
mharizanov

Flow Info

created 3 years, 1 month ago

Node Types

Core
  • comment (x2)
  • debug (x1)
  • delay (x1)
  • exec (x1)
  • function (x3)
  • http request (x1)
  • inject (x1)
  • switch (x2)
Other

Tags

  • dynmic
  • dns
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option