diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5d3ea03 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +*.ini diff --git a/bind-api.py b/bind-api.py index 9019b8b..47ba716 100755 --- a/bind-api.py +++ b/bind-api.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -import ConfigParser +import configparser import dns.tsigkeyring import dns.resolver import dns.update @@ -20,7 +20,7 @@ def parse_config(config): password required to perform dynamic DNS updates """ options = {} - parser = ConfigParser.ConfigParser() + parser = configparser.ConfigParser() parser.read(config) options['nameserver'] = parser.get('nameserver', 'server') @@ -151,4 +151,4 @@ def dns_mgmt(domain, ttl, record_type, response): if __name__ == '__main__': - app.run(debug=True) + app.run(host='0.0.0.0',port=5001,debug=True) diff --git a/config.ini b/config.ini deleted file mode 100644 index ef3bceb..0000000 --- a/config.ini +++ /dev/null @@ -1,9 +0,0 @@ -[nameserver] -server = 172.16.33.135 - -[auth] -username = TRANSFER -password = /h9xIk0tbF3A0lOzy6BYAQ== - -[zones] -valid = ops.internal.net,eng.internal.net diff --git a/config.ini.sample b/config.ini.sample new file mode 100644 index 0000000..3dfa1e6 --- /dev/null +++ b/config.ini.sample @@ -0,0 +1,9 @@ +[nameserver] +server = 127.0.0.1 + +[auth] +username = example.com. +password = hS7nabA8gHDEiGmZD+tyCDWYtcY8D3rH6pPlzbIrYGv6KJ7JF+b14sDjqrpriIqOlJhY7P0lBec8DsjOzuQNaw== + +[zones] +valid = example.com