my_coredns_plugin

package module
v0.0.0-...-0cd64ec Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: MIT Imports: 6 Imported by: 0

README

my_coredns_plugin

Steps

  1. Clone coredns repo https://github.com/coredns/coredns
  2. Add following line in plugin.cfg file of coredns repo:
myplugin:github.com/Prithvipal/my_coredns_plugin
  1. Run make command in coredns repo
make
  1. add myplugin in Corefile
. {
   myplugin
   log
}

  1. Run coredns by following command in coredns repo. Note: set valid path of -conf flag. In my case it I have added relative path
coredns -conf ../../coredns/Corefile
  1. run dig command to verify that myplugin is added sucessfully or not
dig @localhost google.com

When you see the coredns logs, you will see following logs which is added as fmt.Println in myplugin.

=====Yoooo Serving DNS

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyPlugin

type MyPlugin struct {
	Next plugin.Handler
}

func (MyPlugin) Name

func (m MyPlugin) Name() string

func (MyPlugin) Ready

func (e MyPlugin) Ready() bool

func (MyPlugin) ServeDNS

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

type ResponsePrinter

type ResponsePrinter struct {
	dns.ResponseWriter
}

func NewResponsePrinter

func NewResponsePrinter(w dns.ResponseWriter) *ResponsePrinter

NewResponsePrinter returns ResponseWriter.

Jump to

Keyboard shortcuts

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