Code Monkey home page Code Monkey logo

dnspod's Introduction

dnspod.py

@author migege
@version 0.0.2

dnspod.py 是基于 DNSPod 服务的动态 DNS 脚本,用于检测 IP 变化并更新至 DNSPod,支持多域名解析。支持 Linux 设备,包括树莓派(Raspberry Pi)。

Prerequisites

  1. python
  2. pyyaml
  3. requests

python 的模块可通过 pip install 命令安装。如果未安装 pip,请先安装 pip。

Installation

安装 git 客户端,通过本命令获取 dnspod.py

git clone https://github.com/migege/dnspod.git dnspod

然后到 dnspod 目录下新建 conf.yaml 文件,根据您的 DNSPod 设置,填入以下内容:

token: <your_api_token>
sub_domains:
  <your_first_sub_domain_name>:
    domain_id: <your_domain_id>
    record_id: <your_record_id>
  <your_second_sub_domain_name>:
    domain_id: <your_domain_id>
    record_id: <your_record_id>

最后设置 crontab 定时任务

*/10 * * * * cd <path_to_dnspod>; /usr/bin/python dnspod.py conf.yaml > /dev/null 2>&1 &

Tips

  1. */10 表示每 10 分钟执行一次 dnspod.py
  2. 如果 python 可执行路径不是 /usr/bin/python,请自行替换

dnspod's People

Contributors

migege avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dnspod's Issues

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.