Comments (3)
I forgot to add errors
to the Corefile. Everything now works as expected. Thank you!
from example.
There needs to be a plugin that can answer the query in the plugin chain after example. once an answer is generated, example plugin prints "example" just before sending the answer to the client.
If you included the errors plugin, you'd see a "no next plugin" error, meaning that the example plugin tried passing the query to the next plugin, but there isn't one.
explained in this comment...
func (e Example) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
// This function could be simpler. I.e. just fmt.Println("example") here, but we want to show
// a slightly more complex example as to make this more interesting.
// Here we wrap the dns.ResponseWriter in a new ResponseWriter and call the next plugin, when the
// answer comes back, it will print "example".
from example.
Thank you for your solution -- if I add forward
plugin then it works as expected (prints "example" to output).
$ cat plugin.cfg
errors:errors
log:log
example:example
forward:forward
$ cat Corefile
example.com {
forward . 9.9.9.9
example
}
You've mentioned that errors
plugin could be useful here so I decided to try it and tested the following configuration:
$ cat plugin.cfg
errors:errors
log:log
example:example
$ cat Corefile
example.com {
example
}
$ make && ./coredns -dns.port 1337
(another terminal)$ dig @127.0.0.1 -p 1337 example.com
# Expected: "no next plugin" error must appear in the coredns output.
# Actual: no error message is printed to the output.
As you can see no error message is printed. Could you, please, advise me how to use errors
plugin in this situation. This is not important so feel free to close this issues without answering my second question.
from example.
Related Issues (6)
- Add LICENSE HOT 1
- add metrics
- add health.Healther
- deploys fails HOT 3
- Example is not compiling HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from example.