bind-restapi:BIND DNS的RESTful json api

  • v8_351868
    了解作者
  • 3.1KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-23 11:21
    上传日期
绑定restapi 一种快速简单的RESTful BIND RESTful API,以Ruby / Sinatra编写。 提供使用现有的BIND DNS体系结构添加/删除条目的功能。 我将其写为一种解决方案,使我们的内部云能够通过与我们现有的DNS架构集成来向DNS添加/删除计算机。 使用说明 # cd etc/ # named -c named.conf $ ruby dns.rb 将记录添加到DNS: $ curl -X POST -H 'Content-Type: application/json' -H 'X-Api-Key: secret' -d '{ "hostname":
bind-restapi-master.zip
  • bind-restapi-master
  • etc
  • named.conf
    328B
  • 1.1.1.in-addr.arpa.db
    306B
  • apple.com.db
    333B
  • dns.rb
    1.9KB
  • README.md
    1.6KB
内容介绍
# bind-restapi A quick and simple RESTful API to BIND, written in Ruby / Sinatra. Provides the ability to add/remove entries with an existing BIND DNS architecture. I wrote this as a solution to enable our internal Cloud to add/remove machines to DNS by integrating with the DNS architecture that we have today. ## Instructions # cd etc/ # named -c named.conf $ ruby dns.rb ### Add a record to DNS: $ curl -X POST -H 'Content-Type: application/json' -H 'X-Api-Key: secret' -d '{ "hostname": "host12.apple.com", "ip": "1.1.1.12" }' http://localhost:4567/dns ### Remove a record from DNS: $ curl -X DELETE -H 'Content-Type: application/json' -H 'X-Api-Key: secret' -d '{ "hostname": "host12.apple.com", "ip": "1.1.1.12" }' http://localhost:4567/dns ## API The API supports POST and DELETE methods to add and remove entries, respectively. On a successful POST a 201 is returned. On a successful DELETE a 200 is returned. Duplicate records are never created. The API can reside on a local *or* remote DNS server. On a POST request, the API adds **both** the *forward* zone **and** *reverse* in-addr.arpa zone entry as a convenience. On a DELETE request, the API removes **both** the *forward* zone **and** *reverse* in-addr.arpa zone entry as a connivence. The TTL and other DNS params are hard-coded inside of <code>dns.rb</code> ## Security The API is protected by way of an API-Key using a custom <code>X-Api-Key</code> HTTP header. The API should also be served over a secure connection. ## etc Example named configuration files are included to help get started with integrating <code>dns.rb</code> with BIND.
评论
    相关推荐