# dnspod **Repository Path**: Harry6011/dnspod ## Basic Information - **Project Name**: dnspod - **Description**: dnspod.py 是基于 DNSPod 服务的动态 DNS 脚本,用于检测 IP 变化并更新至 DNSPod,支持多域名解析。支持 Linux 设备,包括树莓派(Raspberry Pi)。 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-06-29 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # dnspod.py ``` @author migege @version 0.0.2 ``` dnspod.py 是基于 [DNSPod](http://www.dnspod.cn/docs/records.html#dns) 服务的动态 DNS 脚本,用于检测 IP 变化并更新至 DNSPod,支持多域名解析。支持 Linux 设备,包括树莓派([Raspberry Pi](https://www.raspberrypi.org/))。 # Prerequisites 1. python 1. pyyaml 1. requests python 的模块可通过 ```pip install``` 命令安装。如果未安装 [pip](https://pip.pypa.io/),请先安装 pip。 # Installation 安装 [git](https://git-scm.com/) 客户端,通过本命令获取 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 1. 如果 python 可执行路径不是 /usr/bin/python,请自行替换