Settings

Theme

Show HN: Simple Dynamic DNS Using the Cloudflare API

github.com

19 points by lyoshenka 10 years ago · 4 comments

Reader

nmjohn 10 years ago

Nice - I've previously implemented this in (albeit far less extensible) a curl request, it's been working without hiccup for a while now as a cronjob

    CURRENT_IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
    curl -X PUT 'https://api.cloudflare.com/client/v4/zones/'"$ZONE"'/dns_records/'"$DNS_RECORD_ID" \
      -H "Content-Type:application/json" \
      -H "X-Auth-Key:$AUTH_KEY" \
      -H "X-Auth-Email:$AUTH_EMAIL" \
      --data '{"zone_name":"'$ZONE_NAME'","zone_id":"'$ZONE'","type":"A","name":"'$ZONE_REC_NAME'","content":"'$CURRENT_IP'","data":{},"proxied":false,"proxiable":false,"ttl":1,"priority":1,"id":"'$DNS_RECORD_ID'","locked":false,"modified_on":"2015-08-26T03:10:40.975863Z","created_on":"2015-08-26T03:10:40.975863Z","meta":{"auto_added":false}}'
stevekemp 10 years ago

Sounds like a fun project.

I setup some code over at http://dhcp.io/ which presents an API for updating DynamicDNS via Amazon's route53 infrastructure.

I disabled new registrations due to abuse, but the code is open and I have about 1000 registered users. (5% of whom said they'd pay. 0% of whom did so when I made it an option. Gave up on charging at that point. Also disabled the registrations about a day later!)

e28eta 10 years ago

I'm also using Cloudflare for DDNS, but I'm using my router's support for updating DDNS: I'm hosting a basic Sinatra app on Heroku that the router can ping. The app does a (very basic) auth check, extracts the public IP, and updates Cloudflare.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection