goKvsDns

command module
v0.0.0-...-f8362a8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2020 License: MIT Imports: 10 Imported by: 0

README

Release

Key Value Store DNS Server

This is a DNS Server that uses one of three Key Value Databases (Cassandra is a Column Database but we use it as if) as a DNS Resource Record Backend to answer queries.

This application uses Redis, Cassandra or Etcd to store the RRs in a distributed fashion. This allows us to have atomic updates for each record, easy RR distribution accross a datacenter or multiple datacenters and reliability.

TODO: DNSSec, Zone Transfer.

̀Disclaimer

Currently a Work in Progress. Intended as a research application.

System requirements

Since the application is meant to be backend distributed with a single entrypoint you need at least 3 machines.

On the main machine:

  • Go 1.14
  • Ansible >= 2.7 via python or package manager
  • An SSH Key

On each machine:

  • SSH-Server
  • The following ports, which you can configure on the ansible inventory/group_vars
    • Redis: 7001,7002,7003,7004,7005,7006 and 17001,17002,17003,17004,17005,17006 since Redis uses "server port + 10" for intercluster gossip.
    • Cassandra: 7000, 9042, 9160
    • Etcd: 2380, 2379

Ansible will compile each database on the system checking for the system requirements.

Setup

First to set up the databases you need to have remote access to the remote machines and sudo access. The connection assumes the following:

  • You have added your public key to the remote servers.
  • The same user is present on every system.
  • You have root privileges for each user.

Then you need to add your servers to the Ansible inventory. Go over to scripts/inventory/hosts and modify your IP addresses and ports if the default ports are already in use. Add the IP port:combination to the Makefile variables and the database name.

To Build

$ make build

To start the server

$ make run

Ansible will prompt you asking for the sudo password to install the db on the remote servers.

Utils

TODO

Documentation

Overview

Copyright 2020 Dario Palma. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Go DNS server is a nameserver that uses Distributed Key Value Stores to handle the DNS Resource Records. It admits queries of type A, AAAA, NS, TXT, PTR, CNAME, SOA and MX acting as an authorative DNS server.

Basic use pattern:

go-kvs-dns-server --clusterIPs "192.168.0.240,192.168.0.241,192.168.0.242" \
  --print --db cassandra --port 8053

then:

dig @localhost -p 8053 this.is.my.domain.andhael.cl A

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2157
;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
;this.is.my.domain.andhael.cl.			IN	A

;; ANSWER SECTION:
this.is.my.domain.andhael.cl.		0	IN	A	127.0.0.1

;; ADDITIONAL SECTION:
this.is.my.domain.andhael.cl.		0	IN	TXT	"Port: 56195 (udp)"

Inspired on Reflect Server by Miek Gieben <miek@miek.nl>.

Directories

Path Synopsis
cmd
dnsrequester
Q is a small utility which acts and behaves like 'dig' from BIND.
Q is a small utility which acts and behaves like 'dig' from BIND.
queryuploader
Read DNS RR from a file to upload its contents to a db of the users choice Basic use pattern: queryuploader --clusterIPs 192.168.0.2,192.168.0.3 --db cassandra --df ./file Or if the data is on different zonefiles you can read them by: queryuploader --clusterIPs 192.168.0.2,192.168.0.3 --db cassandra --useZones --dd ./zones NB: add the necessary ports for each redis and etcd server.
Read DNS RR from a file to upload its contents to a db of the users choice Basic use pattern: queryuploader --clusterIPs 192.168.0.2,192.168.0.3 --db cassandra --df ./file Or if the data is on different zonefiles you can read them by: queryuploader --clusterIPs 192.168.0.2,192.168.0.3 --db cassandra --useZones --dd ./zones NB: add the necessary ports for each redis and etcd server.
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL