Closed PenelopeFudd closed 5 months ago
Hello @PenelopeFudd 🙂
thanks for suggesting this enhancement, I think this enhancement makes sense and I like your suggestion to introduce a new flag --fail
that will configure conditions upon which the dnspyre will exit with non-zero status
I can image supporting these conditions:
ioerror
= dnspyre exits with a non-zero status code if there is at least 1 IO error (dnspyre failed to send DNS request or receive DNS response)negative
= dnspyre exits with a non-zero status code if there is at least 1 negative DNS answer (NXDOMAIN or NODATA response)error
= dnspyre exits with a non-zero status code if there is at least 1 error DNS response (SERVFAIL, FORMERR, REFUSED, etc.)idmismatch
= dnspyre exits with a non-zero status code if there is at least 1 ID mismatch between DNS request and responseand I will allow users to specify any combination of these conditions (like dnspyre --fail=ioerror,error
google.com)
do you think this makes sense @PenelopeFudd?
This looks like the best DNS benchmarking program out there!
Thanks, glad to hear that 🙂
Yes, that's exactly it, thank you!
Hello @PenelopeFudd, I have released a new version v3.1.0
of dnspyre, that now supports --fail
flag, you can check the documentation https://tantalor93.github.io/dnspyre/failoncondition.html for usage, hope it fits your use case! Thank you!
Er, one more request: --fail any
, if any kind of error is found? Otherwise it's rather long to specify --fail ioerror --fail error --fail negative --fail idmismatch
.
hmm, I understand, that it can be a little bit tedious to list all the conditions.
I am struggling with the semantics of such option any
, it can be interpreted in many ways. Should it fail if there is any IOerror and DNS error, or should it also fail when there is a negative answer ? Negative answers usually are not a problem of the server but of the client asking for something that does not exist. Should truncated answers be considered also under the any
option?
It's true that it could be interpreted in many ways, although I was thinking of the basic "any of the errors that could be specified with --fail", as a way to see if everything is perfect or not. If I start looking into negative or truncated answers, then it'd be time to explicitly list what counts as an error.
Describe the feature I'd like to have dnspyre return a nonzero exit code if any requests failed. Different people might have different definitions of failure at different times (e.g. connect timeout, nxdomain, duplicate answers, wrong answers, bad certificate, etc), so the parameter might take an argument:
--fail="timeout,nxdomain"
Why do you need this feature I have a program that does binary searches. It'll run a specified program and fill in a specified parameter with a number, and based on the return code of the program, will search until it finds the number where the program just starts to fail:
Without this feature, I have to write a wrapper script that runs dnspyre and then greps for a success or failure string.
For an example, see the
--fail
argument forcurl
.Thanks!
PS: This looks like the best DNS benchmarking program out there! DNSperf / DNSRes are hard to use, Flamethrower is hard in a different way, and DNS shotgun is... weird? Dnspyre looks polished, and it has all the protocols I'm looking for.