dns

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

DNS

A DNS server for use within Loophole Labs projects

Documentation

Index

Constants

View Source
const (
	Mbox = "admin."
)

Variables

View Source
var (
	ErrDisabled        = errors.New("dns is disabled")
	ErrInvalidPublicIP = errors.New("invalid public ip")
)

Functions

This section is empty.

Types

type ChallengeEvent

type ChallengeEvent struct {
	// ID is the unique identifier of the dns challenge
	ID string

	// Deleted indicates whether the dns challenge was deleted
	Deleted bool

	// Challenge is the challenge that was created or updated.
	// If the challenge was deleted, this will be nil
	Challenge string
}

ChallengeEvent is the event that is emitted when a DNS challenge is created, updated, or deleted

type DNS

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

func New

func New(options *Options, storage Storage, logger *zerolog.Logger) (*DNS, error)

func (*DNS) Start

func (d *DNS) Start() error

func (*DNS) Stop

func (d *DNS) Stop() error

func (*DNS) ValidARecordQuestion

func (d *DNS) ValidARecordQuestion(domain string) bool

func (*DNS) ValidNSRecordQuestion

func (d *DNS) ValidNSRecordQuestion(domain string) bool

func (*DNS) ValidSOARecordQuestion

func (d *DNS) ValidSOARecordQuestion(domain string) bool

func (*DNS) ValidTXTRecordQuestion

func (d *DNS) ValidTXTRecordQuestion(domain string) (bool, string)

type Options

type Options struct {
	LogName         string
	Disabled        bool
	ListenAddress   string
	PublicIP        string
	RootDomain      string
	CNAMERootDomain string
}

type Storage

type Storage interface {
	SubscribeToDNSChallenges(ctx context.Context) <-chan *ChallengeEvent
	ListDNSChallenges(ctx context.Context) ([]ChallengeEvent, error)
}

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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