Giter Site home page Giter Site logo

ddns's Introduction

ddns

DDNS更新脚本

操作系统openwrt

域名服务商DNSPod

替换wan接口

将源码中的pppoe-wan3替换为对应的wan接口名

获取域名和记录 ID

安装curl

给 OpenWrt 安装 cURL:

$ sudo opkg update

$ sudo opkg install curl

然后前往 DNSPod 的后台创建一个login_token,并通过 DNSPod 的 API 获取域名列表 和 记录列表 分别取得域名 ID(DOMAIN_ID)和记录 ID(RECORD_ID),记下这两个 ID,相关请求如下:

获取域名ID

curl -X POST https://dnsapi.cn/Domain.List -d 'login_token=LOGIN_TOKEN&format=json'

获取记录ID

curl -X POST https://dnsapi.cn/Record.List -d 'login_token=LOGIN_TOKEN&format=json&domain_id=DOMAIN_ID'

若提示类似下面的错误

curl: (77) Error reading ca cert path /etc/ssl/certs - PolarSSL: (-0x2900) X509 - Read/write of file failed

可以试着安装 ca-certificates 后重试 opkg install ca-certificates ca-bundle

使用

将脚本存放到openwrt中,在luci的ddns设置中的“自定义更新脚本”设置对应路径

ddns's People

Contributors

thunderbirdwang avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.