dig does not display YAML output for errors when using protocols other than UDP
Summary
When running dig with the +yaml option no output is returned when an error occurs using a protocol other than UDP
BIND version used
DiG 9.18.16
Steps to reproduce
- Run dig with +tcp and an invalid resolver: dig +yaml +tries=1 +time=1 +tcp @1.1.1.4 google.com A -4
- no output is returned
- exit code is 9
What is the current bug behavior?
No output is returned for +tcp, +tls or +http errors
What is the expected correct behavior?
dig should return the following output when failing to contact a resolver using any of the supported protocols:
dig +yaml +tries=1 +time=1 +notcp @1.1.1.4 google.com A -4
type: DIG_ERROR message: | no servers could be reached
Relevant configuration files
N/A
Relevant logs and/or screenshots
dig with +notcp:
user@box> dig +yaml +tries=1 +time=1 +notcp @1.1.1.4 google.com A -4
type: DIG_ERROR message: | no servers could be reached
user@box> echo $?
9
dig with +tcp:
user@box> dig +yaml +tries=1 +time=1 +tcp @1.1.1.4 google.com A -4
user@box> echo $?
9
Possible fixes
(If you can, link to the line of code that might be responsible for the problem.)
Edited by Atahualpa Ledesma