Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include coredns plugin at node-cache don't work expect #436

Closed
zhangguanzhang opened this issue Feb 2, 2021 · 3 comments
Closed

include coredns plugin at node-cache don't work expect #436

zhangguanzhang opened this issue Feb 2, 2021 · 3 comments

Comments

@zhangguanzhang
Copy link

zhangguanzhang commented Feb 2, 2021

edit file cmd/node-cache/main.go

	_ "github.com/coredns/coredns/plugin/whoami"
	_ "github.com/leiless/dnsredir"  <--- add this

and build , and run with option -plugins list them

Server types:
  dns

Caddyfile loaders:
  flag
  default

Other plugins:
  dns.bind
  dns.cache
  dns.debug
  dns.dnsredir  <--- at here
  dns.dnstap
  dns.errors
  dns.forward
  dns.health
  dns.loadbalance
  dns.log
  dns.loop
  dns.metadata
  dns.pprof
  dns.prometheus
  dns.reload
  dns.template
  dns.whoami

but run failed with

2021/02/02 04:27:09 [INFO] Updated Corefile with 0 custom stubdomains and upstream servers /etc/resolv.conf
2021/02/02 04:27:09 [INFO] Using config file:
cluster1.local:53 {
    errors
    reload
    dnsredir . {
        to 10.11.86.107:153 10.11.86.108:153 10.11.86.109:153
        max_fails 1
        health_check 1s
        spray
    }
    #forward . 10.11.86.107:153 10.11.86.108:153 10.11.86.109:153 {
    #    force_tcp
    #    max_fails 1
    #    policy round_robin
    #    health_check 0.4s
    #}
    prometheus :9253
    health 169.254.20.10:8080
}
/etc/Corefile:4 - Error during parsing: Unknown directive 'dnsredir'
@prameshj
Copy link
Contributor

As detailed in https://coredns.io/2017/03/01/how-to-add-plugins-to-coredns/#4-hooking-it-up, looks like the new plugin needs to be added to plugin.cfg and some code to be generated with "go generate && go build". Since node-cache vendors in coredns repo, you might be able to do it there for local testing.

@prameshj
Copy link
Contributor

Any update here? Closing for now, please reopen if needed.

@zhangguanzhang
Copy link
Author

I copied part of the code and wrote a tool, there is no need to introduce additional plug-ins to do what I want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants