TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Simple Dynamic DNS Using the Cloudflare API

19 点作者 lyoshenka超过 9 年前

3 条评论

nmjohn超过 9 年前
Nice - I&#x27;ve previously implemented this in (albeit far less extensible) a curl request, it&#x27;s been working without hiccup for a while now as a cronjob<p><pre><code> CURRENT_IP=$(dig +short myip.opendns.com @resolver1.opendns.com) curl -X PUT &#x27;https:&#x2F;&#x2F;api.cloudflare.com&#x2F;client&#x2F;v4&#x2F;zones&#x2F;&#x27;&quot;$ZONE&quot;&#x27;&#x2F;dns_records&#x2F;&#x27;&quot;$DNS_RECORD_ID&quot; \ -H &quot;Content-Type:application&#x2F;json&quot; \ -H &quot;X-Auth-Key:$AUTH_KEY&quot; \ -H &quot;X-Auth-Email:$AUTH_EMAIL&quot; \ --data &#x27;{&quot;zone_name&quot;:&quot;&#x27;$ZONE_NAME&#x27;&quot;,&quot;zone_id&quot;:&quot;&#x27;$ZONE&#x27;&quot;,&quot;type&quot;:&quot;A&quot;,&quot;name&quot;:&quot;&#x27;$ZONE_REC_NAME&#x27;&quot;,&quot;content&quot;:&quot;&#x27;$CURRENT_IP&#x27;&quot;,&quot;data&quot;:{},&quot;proxied&quot;:false,&quot;proxiable&quot;:false,&quot;ttl&quot;:1,&quot;priority&quot;:1,&quot;id&quot;:&quot;&#x27;$DNS_RECORD_ID&#x27;&quot;,&quot;locked&quot;:false,&quot;modified_on&quot;:&quot;2015-08-26T03:10:40.975863Z&quot;,&quot;created_on&quot;:&quot;2015-08-26T03:10:40.975863Z&quot;,&quot;meta&quot;:{&quot;auto_added&quot;:false}}&#x27;</code></pre>
评论 #10535219 未加载
stevekemp超过 9 年前
Sounds like a fun project.<p>I setup some code over at <a href="http:&#x2F;&#x2F;dhcp.io&#x2F;" rel="nofollow">http:&#x2F;&#x2F;dhcp.io&#x2F;</a> which presents an API for updating DynamicDNS via Amazon&#x27;s route53 infrastructure.<p>I disabled new registrations due to abuse, but the code is open and I have about 1000 registered users. (5% of whom said they&#x27;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超过 9 年前
I&#x27;m also using Cloudflare for DDNS, but I&#x27;m using my router&#x27;s support for updating DDNS: I&#x27;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.