Git Product home page Git Product logo

bind-restapi's Introduction

bind-restapi

A quick and simple RESTful API to BIND, written in Python/Tornado. Provides the ability to add/remove entries with an existing BIND DNS architecture.

Based on the work of https://github.com/ajclark/bind-restapi Rewritten with Python and Tornado. To daemonize, daemon.py is used: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python

Instructions

$ Customize defines inside bind-restapi.py
$ python bind-restapi.py start

Add a record to DNS:

$ curl -X POST -H 'Content-Type: application/json' -H 'X-Api-Key: secret' -d '{ "hostname": "host.example.com", "ip": "1.1.1.10", "ptr": "yes", "ttl": 86400}' http://localhost:9999/dns

Remove a record from DNS:

$ curl -X DELETE -H 'Content-Type: application/json' -H 'X-Api-Key: secret' -d '{ "hostname": "host.example.com"}' http://localhos    t:  9999/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 ONLY if {"ptr": "yes"} is specified.

On a DELETE request, the API removes both the forward zone and reverse in-addr.arpa zone entry as a connivence

The TTL, portand other DNS params are hard-coded inside of dns.rb

TTL can be overriden from the request with {"ttl": "$TTL"}

Security

The API is protected by way of an API-Key using a custom X-Api-Key HTTP header. The API should also be served over a secure connection.

bind-restapi's People

Contributors

icc-vela avatar jvdiago 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.