data_mesher

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: MIT Imports: 16 Imported by: 0

README

coredns-data-mesher

Name

data-mesher - responds to DNS queries with Data Mesher's's distributed DNS

Description

Data Mesher is an eventually consistent, decentralised data service that provides DNS for a cluster. It's a part of the Clan computer management framework.

Data Mesher works great on machines that are managed by Clan. However, if you want to add a mobile device, you need some way for it to learn about DNS in your cluster. See https://git.clan.lol/clan/clan-core/issues/1268 for more information.

Compilation

This package is compiled as part of CoreDNS and not in a standalone way.

The manual has more information about how to configure and extend the server with external plugins.

A simple way to consume this plugin is by adding the following to plugin.cfg, and recompiling it as detailed on coredns.io.

data-mesher:github.com/jfly/coredns-data-mesher

Put this early in the plugin list, so that example is executed before any of the other plugins.

After this you can compile coredns by:

make

Syntax

data-mesher

Metrics

If monitoring is enabled (via the prometheus directive) the following metric is exported:

  • coredns_data_mesher_request_count_total{server} - query count to the data_mesher plugin.

The server label indicated which server handled the request, see the metrics plugin for details.

Ready

This plugin reports readiness to the ready plugin. It will be immediately ready.

Examples

In this configuration, we first query Data Mesher, if Data Mesher does not have a response, we then forward queries to 9.9.9.9.

. {
  debug
  log

  data-mesher
  forward . 8.8.8.8 9.9.9.9
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataMesher

type DataMesher struct {
	Next plugin.Handler
	// contains filtered or unexported fields
}

func (DataMesher) Name

func (e DataMesher) Name() string

Name implements the Handler interface.

func (DataMesher) Ready

func (e DataMesher) Ready() bool

Ready implements the ready.Readiness interface, once this flips to true CoreDNS assumes this plugin is ready for queries; it is not checked again.

func (DataMesher) ServeDNS

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

type HostEntry

type HostEntry struct {
	Hostname string   `json:"hostname"`
	IPs      []string `json:"ips"`
}

type ResponsePrinter

type ResponsePrinter struct {
	dns.ResponseWriter
}

ResponsePrinter wrap a dns.ResponseWriter and will write "data-mesher" to standard output when WriteMsg is called.

func NewResponsePrinter

func NewResponsePrinter(w dns.ResponseWriter) *ResponsePrinter

NewResponsePrinter returns ResponseWriter.

func (*ResponsePrinter) WriteMsg

func (r *ResponsePrinter) WriteMsg(res *dns.Msg) error

`WriteMsg` calls the underlying `ResponseWriters`'s `WriteMsg` method and prints "data-mesher" to standard output.

Jump to

Keyboard shortcuts

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