- Clone coredns repo https://github.com/coredns/coredns
- Add following line in
plugin.cfg
file of coredns repo:
myplugin:github.com/Prithvipal/my_coredns_plugin
- Run make command in coredns repo
make
- add
myplugin
in Corefile
. {
myplugin
log
}
- 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
- 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