{"id":166419,"date":"2020-10-14T05:12:41","date_gmt":"2020-10-13T21:12:41","guid":{"rendered":"http:\/\/4563.org\/?p=166419"},"modified":"2020-10-14T05:12:41","modified_gmt":"2020-10-13T21:12:41","slug":"%e5%85%b3%e4%ba%8eddns%e7%9a%84%e8%84%9a%e6%9c%ac%e6%b1%82%e5%8a%a9","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=166419","title":{"rendered":"\u5173\u4e8eddns\u7684\u811a\u672c\u6c42\u52a9"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>s07q<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u5173\u4e8eddns\u7684\u811a\u672c\u6c42\u52a9<\/h3>\n<p>  \t\t\u4e0b\u9762\u8fd9\u4e2a\u662f\u6885\u6797\u7684ddns\u811a\u672c\u4ee3\u7801\uff0c\u76ee\u524d\u6211\u662f\u6bcf\u65e5\u5b9a\u65f6\u6267\u884c\u4e00\u6b21\uff0c\u4e00\u822c\u7f51\u7edc\u90fd\u662f\u5728\u51cc\u6668\u53d1\u751f\u53d8\u5316<br \/>  \u6700\u8fd1\u7a81\u7136\u53d1\u73b0\u767d\u5929\u4e5f\u53d8\u4e86\uff0cMMP<br \/>  \u90a3\u4e48\u95ee\u9898\u6765\u4e86\uff0c\u5982\u679c\u6539\u62105\u5206\u949f\u6267\u884c\u4e00\u6b21\uff0c\u6821\u9a8cIP\u662f\u5426\u53d1\u751f\u6539\u53d8\uff0c\u6539\u53d8\u4e86\u624d\u6267\u884c\u66f4\u65b0\u7684\u8bdd\u8981\u600e\u4e48\u505a\uff1f\u4e0d\u60f3\u66b4\u529b\u65e0\u8111\u66f4\u65b0<br \/>  \u627e\u4e2a\u6587\u6863\u5b58IP \u6bcf\u66f4\u65b0\u4e00\u6b21\u5c31\u66ff\u6362\u4e00\u6b21\uff1f\uff1f<br \/>  \u6216\u8005MJJ\u6709\u9020\u597d\u7684\u8f6e\u5b50\u5206\u4eab\u4e2a<br \/>  openwrt\u7684\u4e5f\u884c<br \/>  \u8c22\u8c22<\/p>\n<p>  #!\/bin\/sh<\/p>\n<p>  APIKEY=&quot;apikey&quot;<br \/>  DOMAIN=&quot;domain&quot;<br \/>  HOST=&quot;host&quot;<br \/>  IP=${1}<\/p>\n<p>  if [ -z &quot;$HOST&quot; ]; then<br \/>  FULLDOMAIN=$DOMAIN<br \/>  else<br \/>  FULLDOMAIN=$HOST.$DOMAIN<br \/>  fi<\/p>\n<p>  # Fetch DNS record ID<br \/>  RESPONSE=&quot;$(curl -s &quot;https:\/\/www.namesilo.com\/api\/dnsListRecords?version=1&amp;type=xml&amp;key=$APIKEY&amp;domain=$DOMAIN&quot;)&quot;<br \/>  RECORD_ID=&quot;$(echo $RESPONSE | sed -n &quot;s\/^.*&lt;record_id&gt;(.*)&lt;\/record_id&gt;.*&lt;type&gt;A&lt;\/type&gt;&lt;host&gt;$FULLDOMAIN&lt;\/host&gt;.*$\/1\/p&quot;)&quot;<\/p>\n<p>  # Update DNS record in Namesilo<br \/>  RESPONSE=&quot;$(curl -s &quot;https:\/\/www.namesilo.com\/api\/dnsUpdateRecord?version=1&amp;type=xml&amp;key=$APIKEY&amp;domain=$DOMAIN&amp;rrid=$RECORD_ID&amp;rrhost=$HOST&amp;rrvalue=$IP&amp;rrttl=7207&quot;)&quot;<\/p>\n<p>  # Check whether the update was successful<br \/>  echo $RESPONSE | grep -E &quot;&lt;code&gt;(280|300)&lt;\/code&gt;&quot; &amp;&gt;\/dev\/null<br \/>  if [ $? -eq 0 ]; then<br \/>  \/sbin\/ddns_custom_updated 1<br \/>  else<br \/>  \/sbin\/ddns_custom_updated 0<br \/>  fi\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u590f\u751f\u554a<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t5\u5206\u949f\u4e00\u6b21\u4e0d\u7528\u6539\u8fd9\u4e2a\uff0c\u6539crontab\u4e0d\u5c31\u884c\u4e86.\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>yanaxiao<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6885\u6797\u7684\u8f6f\u4ef6\u4e2d\u5fc3\u4e0d\u662f\u6709DDNS\u8f6f\u4ef6\uff1f\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>s07q<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u590f\u751f\u554a \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-10-13 21:59<br \/>  5\u5206\u949f\u4e00\u6b21\u4e0d\u7528\u6539\u8fd9\u4e2a\uff0c\u6539crontab\u4e0d\u5c31\u884c\u4e86.<\/p>\n<p> \u5173\u952e\u662f \u60f3IP\u53d8\u4e86\u7684\u65f6\u5019\u518d\u66f4\u65b0\uff0c\u8fd9\u91cc\u5c31\u662f\u6bcf5\u5206\u949f\u66f4\u4e00\u6b21\u65e0\u8111\u66f4\u65b0\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>s07q<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tyanaxiao \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-10-13 22:00<br \/>  \u6885\u6797\u7684\u8f6f\u4ef6\u4e2d\u5fc3\u4e0d\u662f\u6709DDNS\u8f6f\u4ef6\uff1f<\/p>\n<p> \u6709\u7684\uff0c\u4e0d\u8fc7\u6211\u57df\u540d\u5728namesilo \u6240\u4ee5\u8981\u7528\u81ea\u5b9a\u4e49\u811a\u672c<br \/>  \u5e76\u4e14\u5b57\u6bb5\u66f4\u65b0\u6709\u95ee\u9898\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u590f\u751f\u554a<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\ts07q \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-10-13 22:08<br \/>  \u5173\u952e\u662f \u60f3IP\u53d8\u4e86\u7684\u65f6\u5019\u518d\u66f4\u65b0\uff0c\u8fd9\u91cc\u5c31\u662f\u6bcf5\u5206\u949f\u66f4\u4e00\u6b21\u65e0\u8111\u66f4\u65b0<\/p>\n<p> \u90a3\u5c31\u5199\u4e2a\u6682\u5b58ip\u7684\u6587\u4ef6\uff0c\u6bcf\u6b21\u8ddf\u4e0a\u6b21\u5bf9\u6bd4\u5c31\u884c\u4e86\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>banyet<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5f88\u7b80\u5355\uff0c \u4fdd\u5b58\u4e00\u4e2a\u6587\u4ef6\u8bb0\u5f55\u5bf9\u5e94\u7684IP\uff0c\u66f4\u65b0\u524d\u5148\u68c0\u67e5IP\u662f\u5426\u53d8\u4e86\u3002\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>s07q \u5927\u4f6c\u6709\u8bdd\u8bf4 : \u5173\u4e8edd&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/166419"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=166419"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/166419\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=166419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=166419"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=166419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}