Skip to content

RESTful API to Bind-DLZ, written by Python/Flask. Providing add/remove/query dns records.

License

Notifications You must be signed in to change notification settings

MoguCloud/bind_dlz_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bind_DLZ_API

RESTful API to Bind-DLZ, written by Python/Flask. Providing add/remove/query dns records.

How To Use

Config and Run

Modify dns_api.conf:

# Run on the given IP.
host =
# Run on the given port.
port = 
# Debug Mode (True of False)
debug =
# Path to the log
log_path =
# table name of the bind-dlz database.
table_name =
# connection to database. e.g, mysql+pymysql://username:password@127.0.0.1/dns
connection =
# Responsible person SOA record. e.g, "root.domain.com.".
resp_person =
# Primary name server SOA record. e.g, "ns.domain.com.".
primary_ns =

Start Bind-DLZ Api:

$ python dns_api.py

Usage

  • Add a DNS record:
$ curl -X POST -H 'Content-Type: application/json' -d '{"zone": "example.com", "host": "test", "type": "A", "data": "1.1.1.1"}' http://localhost:8991/v1.0/dns
  • Delete a DNS record:
curl -X DELETE -H 'Content-Type: application/json' -d '{"zone": "example.com", "host": "test", "type": "A", "data": "1.1.1.1"}' http://localhost:8991/v1.0/dns
  • Get all DNS records:
curl -X GET http://localhost:8991/v1.0/dns
  • Get DNS records by zone:
curl -X GET http://localhost:8991/v1.0/dns/zone

About

RESTful API to Bind-DLZ, written by Python/Flask. Providing add/remove/query dns records.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages