GithubHelp home page GithubHelp logo

ali-ddns's Introduction

项目简述:

通过获取本机公有IP(访问公有ip站点查询网站,正则解析),结合阿里云域名API,通过定时器实现IP与域名的绑定。 方便动态IP的小伙伴把家里闲置的服务暴露到外网.

安装过程

步骤1:下载代码
git clone https://github.com/chenmyGitHub/ali-ddns.git

步骤2:修改application.properties ali.profile.regionId=cn-hangzhou ali.profile.accessKeyId=阿里云账号accessKeyId ali.profile.secret=阿里云账号的secret dnsValue=目标域名(www.touchyou.com)

步骤3:打包 mvn clean package

步骤4:运行 java -jar ali-ddns.jar

HTTP 接口:

  • 获取本机IP字符串
    返回值只包含字符串,不需要解析JSON,但是不好判断服务器请求是否成功(无状态码)
    请求URL: /d-dns/ip/my/string
    请求方式: GET
    参数: 无
    响应结果示例:
111.111.111.111
  • 获取域名解析的IP
    请求URL: /d-dns/dns/bind/current
    请求方式: GET
    参数:
参数名 类型 示例 说明
host String www.baidu.com 要查询的域名地址
响应结果示例:
{"code":200,"msg":"222.222.222.222"}
  • 定时更新ip与dns updatePubIp2Host

ali-ddns's People

Contributors

chenmygithub avatar

Watchers

 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.