https://github.com/ardikabs/dnsmanager-api
DNS Manager API Server
https://github.com/ardikabs/dnsmanager-api
dns-api flask python webservice
Last synced: about 2 months ago
JSON representation
DNS Manager API Server
- Host: GitHub
- URL: https://github.com/ardikabs/dnsmanager-api
- Owner: ardikabs
- License: mit
- Created: 2019-01-02T15:32:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T01:30:42.000Z (over 3 years ago)
- Last Synced: 2025-08-04T14:59:48.756Z (10 months ago)
- Topics: dns-api, flask, python, webservice
- Language: Python
- Homepage:
- Size: 30.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DNS Manager API Server
This is DNS Manager API Server, built with Flask & dnspython package. You can manager your DNS Zone record with this API with simply using keyring variable.
### Prerequisite
* DNS Basic Knowledge (BIND9)
* Python Knowledge
* Docker Knowledge
## Usage
Base URL: `/api/v1/`
### Endpoint
* `/zones/` - Used for manage DNS Zone, method available are:
* `[GET]`
* `[POST]`
* `[PUT]`
* `[DELETE]`
* `/records/` - Used for manage Record that registered on DNS Zone, method available are:
* `[GET]`
* `[POST]`
* `[PUT]`
* `[DELETE]`
### Setup Local Deployment
* Go over in `/project` - Project Directory
* `pip install -r requirements.txt` - Installing Dependency
* `python manage.py recreatedb` - Setup Local Database (make sure change your database default database will using data-dev.db)
* Before running the Server, make sure you just create an environment variable in `.env` file
* `python manage.py run` - Running DNS Manager API Server in `http://localhost:5000/api/v1/`
### Setup Docker Deployment
* Make sure you are running on Linux Operating System (*this is because we need Celery and Gunicorn to start the API Server)
* Before running the Server, make sure you just create an environment variable in `.env` file
* There is 2 ways to deploy with Docker or Docker Compose
* Docker
* Go over in root directory
* `docker build -t /dnsmanager:tag . ` - Create DNS Manager API Server Image
* `docker run -d -p 8080:8080 --name dnsmanager /dnsmanager:tag` - Running DNS Manager API Server Container
* This way you need to install redis in other container or just running in localhost
* Docker Compose
* Go over in root directory
* If necessary make change on docker-compose.yml file for service configuration
* `docker-compose up -d` - Up all service described at docker-compose.yml
* With this way, you will need several container like:
* `redis`
* `postgresdb`
* `dnsmanager`
### Additional Information
This DNS Manager API Server will work to communicate to your DNS Server on specific zone using `Keyring`, with this way its a best practice to communicate on DNS without directly changing on the db file.
If you have an existing DNS Zone that currently have record, with this DNS Manager Server API, we will import all the existing record from the registered zone. We also using a periodic task to check if there is a new record that not added from API and than added to the database.