Coder Social home page Coder Social logo

ff755 / aliddnsnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from real-zony/aliddnsnet

0.0 0.0 0.0 920 KB

使用 C# + .NET Core 开发的开源 DDNS 工具,基于阿里云的 DNS API 接口。

License: MIT License

Shell 3.39% C# 95.33% Dockerfile 1.29%

aliddnsnet's Introduction

0.简要介绍

AliCloudDynamicDNS 是基于 .NET Core 开发的动态 DNS 解析工具,借助于阿里云的 DNS API 来实现域名与动态 IP 的绑定功能。这样你随时就可以通过域名来访问你的设备,而不需要担心 IP 变动的问题。

1.使用说明

使用本工具的时候,请详细阅读使用说明。

1.1 配置说明

通过更改 settings.json.example 的内容来实现 DDNS 更新,其文件内部各个选项的说明如下:

{
  // 阿里云的 Access Id。
  "AccessId": "AccessId",
  // 阿里云的 Access Key。
  "AccessKey": "AccessKey",
  // 主域名。
  "MainDomain": "example.com",
  // 公网 IP 获取服务器地址。
  "PublicIpServer": "https://api.myzony.com/get-ip",
  // 需要批量变更的子域名记录集合。
  "SubDomains": [
    {
      // 子域名记录类型。
      "Type": "A",
      // 子域名记录前缀。
      "SubDomain": "sub1",
      // TTL 时间。
      "Interval": 600
    },
    {
      "Type": "A",
      "SubDomain": "sub2",
      "Interval": 600
    }
  ]
}

其中 Access IdAccess Key 可以登录阿里云之后在右上角可以得到。

1.2 命令参数说明

在运行程序的时候,请建立一个新的 settings.json 文件,在里面填入配置内容,然后执行以下命令:

./AliCloudDynamicDNS

效果图:
1203160-20180722111356778-841949657.png

当然如果你有其他的配置文件也可以通过指定 -f 参数来制定配置文件路径。例如:

./AliCloudDynamicDNS -f ./settings.json

如果你需要启动自动周期检测的话,请通过 -i 参数指定执行周期,单位是秒。

./AliCloudDynamicDNS -f ./settings.json -i 3600

注意:

当你通过 -i 指定了周期之后,请在最末尾使用 & 符号,使应用程序在后台运行。使用群晖的同学,就不要指定 -i 参数了。

2. 如何安装

2.1 基于 Docker 运行

本程序已经打包了 x64 的 Linux Docker 镜像,基于 X86 的机器可以直接执行以下命令拉取并快速执行命令。

docker run -d -ti -v <你的配置文件路径(完整)>:/app/settings.json --name=aliyun-ddns myzony/ali-cloud-dynamic-dns:latest

下面是一个 Docker-Compose 的示例:

docker-compose.yaml

version: '3'
services:
	ddns:
		container_name: aliyun-ddns
		image: myzony/ali-cloud-dynamic-dns:latest
		volume:
			- <你的配置文件路径(完整)>:/app/settings.json
		restart: always

2.2 基于群晖 Docker

TODO

2.3 基于任务计划

以下方法不再建议使用,优先考虑 Docker 模式

群晖使用本工具的话推荐下载 Release 页面的 Linux 版本压缩包,将其通过 WinSCP 传输到群晖 NAS 上面,然后解压之后即可。

例如我这里将其解压到了 /var/services/homes/myzony/newDns/ 这个目录之下,同时我们也将建立一个新的 settings.json 文件,并按照下方配置说明进行设置。

最后我们来到群晖的 DSM 管理面,打开 控制面板 -> 任务计划,添加一个新的任务,例如下图:

群晖设置图1

群晖设置图2

3.下载地址

程序打包了 Linux_x64、Linux_arm64、Windows_x64 的二进制可执行文件,你可以直接下载对应的压缩包解压到你的路由器或者 NAS 里面进行运行。

下载地址在这儿

aliddnsnet's People

Contributors

real-zony avatar dependabot[bot] avatar nicknameisnull 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.