Shark / powerdns-consul

PowerDNS connector for the Consul key value store

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

powerdns-consul

powerdns-consul is a utility written in Go that allows you to use the Consul key value store as a backend for PowerDNS through the Pipe backend.

Some of the PowerDNS-related code is inspired by mindreframer's work.

Usage

  1. Customize the powerdns-consul.json.example configuration
  2. Execute ./powerdns-consul -config=/path/to/powerdns-consul.json
  • Set DEBUG=1 to make powerdns-consul print each request and response

Architecture

powerdns-consul Architecture

powerdns-consul implements the PowerDNS pipe backend protocol. It can use various key-value stores to query for DNS records. Supported key-value store backends are:

  • Consul (tested against v0.7.0)
  • etcd (tested against v3.0.14)

You can organize the data in the key-value store in two different ways (schemas):

  • Flat schema (docs)
  • SkyDNS schema (docs, this will be implemented in a future version)

Building

  • Clone the repository in your $GOPATH/src/github.com/Shark/powerdns-consul
  • Run go get ./...
  • Run make

Testing

  • Go tests: run make test
  • End to end test
    • Run make end2end_test.
    • Requires a working Docker setup.
    • This test will build powerdns-consul and a Docker image with PowerDNS, Consul and powerdns-consul. It will then bootstrap the Consul key-value store and run some 'real world' tests against this setup using dig.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request! :)

History

  • v0.0.1 (2016-04-20): initial version
  • v0.0.2 (2016-11-05): use libkv and support Consul and etcd

License

This project is licensed under the MIT License. See LICENSE for details.

About

PowerDNS connector for the Consul key value store

License:MIT License


Languages

Language:Go 92.6%Language:Shell 4.2%Language:Dockerfile 2.7%Language:Makefile 0.6%