RESTful API to Bind-DLZ, written by Python/Flask. Providing add/remove/query dns records.
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
- 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