zonedns

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

README

ZonedNS

What is it?

ZonedNS is a plugin for a CoreDNS that provides authoritative resolving using MySQL as a backend. The only real difference from other plugins is specific to A/AAAA mapping: it assumes you have certain "deployment zones", with fixed set of A/AAAA records, and domain names can be mapped to these zones ONLY.

How to use?
  1. Follow CoreDNS build instructions, and add zonedns:github.com/raver119/zonedns to plugin.cfg
  2. Provide MySQL credentials, i.e. via ENV in your K8S deployment description.
    DB_HOST="localhost"
    DB_USERNAME="xxxx"
    DB_PASSWORD="yyyyy"
    DB_NAME="database"
    
  3. Add the plugin to your Corefile. I.e.:
.:1053 {
   cache 3600
   zonedns
}

In your management application:

  1. Import the API package into your application: zonedns:github.com/raver119/zonedns-go-api
  2. Use ZoneStorage or ZoneReader implementation to fetch/add/remove/update records/domains/zones in your app
Requirements:
  • CoreDNS
  • MySQL 8.x+
  • Golang 1.13+

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZonedNS

type ZonedNS struct {
	// contains filtered or unexported fields
}

func BuildZonedNS

func BuildZonedNS(zonesUpdateTimeoutSec int64, ttlSec uint32) (ZonedNS, error)

func (ZonedNS) Name

func (z ZonedNS) Name() string

func (ZonedNS) ServeDNS

func (z ZonedNS) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

type Zones

type Zones struct {
	// contains filtered or unexported fields
}

func BuildZones

func BuildZones(zones []api.Zone) Zones

func (*Zones) Get

func (z *Zones) Get(zoneId int64) (zone api.Zone, ok bool)

func (*Zones) Has

func (z *Zones) Has(zoneId int64) (ok bool)

func (*Zones) Update

func (z *Zones) Update(zones []api.Zone)

Directories

Path Synopsis
api module

Jump to

Keyboard shortcuts

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