gnocco

package module
v0.0.0-...-6b050bb Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 14 Imported by: 0

README

Gnocco

a small cache of goodness

Gnocco is a DNS cache with resolver, it is based on the wonderful DNS library from Miek Gieben dns using the iterative resolver from Darvaza.

Gnocco is in very early stages of development with most of its features not implemented yet.

Quick start

  1. Keep in mind that Gnocco is NOT production state
  2. Create an user and group (gnocco user and group are advised but not mandatory)
  3. Create a configuration space (directory) for gnocco (ie. /etc/gnocco)
  4. Move gnocco.conf and roots files in the configuration space
  5. Review and modify gnocco.conf to suit your needs
  6. Create a directory to hold logs (ie. /var/log/gnocco)
  7. Move the gnocco binary to /usr/bin
  8. Run sudo setcap cap_net_bind_service=+ep /usr/bin/gnocco in order to enable Gnocco to listen on ports < 1024 (ie. 53)
  9. Itegrate Gnocco with your init system

Documentation

Overview

Package gnocco is just the root

Index

Constants

View Source
const (
	// DefaultConfigFile specifies the default filename of the config file
	DefaultConfigFile = "gnocco.conf"
	// DefaultLogLevel specifies the log level we handle by default
	DefaultLogLevel = slog.Debug
)

Variables

View Source
var (
	// Version contains the git hashtag injected by make
	Version = "N/A"
	// BuildDate contains the build timestamp injected by make
	BuildDate = "N/A"
)

Functions

func NewHandler

func NewHandler(start string) (dns.Handler, error)

NewHandler allocates an iterative DNS resolver optionally using the given root server as starting point.

func Run

func Run(cf *Config, logger slog.Logger) error

Run creates and runs a gnocco server using the given config

Types

type Config

type Config struct {
	Listen ListenS

	Log LogS
}

Config represents the configuration file for setting up the wilee Server

func (*Config) Prepare

func (c *Config) Prepare() error

Prepare attempts to validate and fill the gaps on a Config object

func (*Config) ReadInFile

func (c *Config) ReadInFile(filename string) error

ReadInFile loads a TOML config file into a Config object, validates and fills the gaps

func (*Config) WriteTo

func (c *Config) WriteTo(w io.Writer) (int64, error)

WriteTo writes the Config in TOML format

type ListenS

type ListenS struct {
	Host string
	Port string
}

ListenS is the Listen config struct

type LogS

type LogS struct {
	Stdout bool
	File   string
}

LogS is the logging config struct

Directories

Path Synopsis
cmd
gnocco
Package main is the main executable
Package main is the main executable
Package zerolog provides a dumb wrapper for logging to os.Stderr using github.com/rs/zerolog
Package zerolog provides a dumb wrapper for logging to os.Stderr using github.com/rs/zerolog

Jump to

Keyboard shortcuts

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