Hello Petr:

On 12/5/22 4:35 AM, Petr Špaček wrote:

> On 05. 12. 22 3:49, Fred Morris wrote:
>> If the UDP query returns TC=1 DiG retries with TCP. I want to see the
>> UDP results and am unable to. Specifying +notcp makes no difference.
>> The correct option is +ignore:
>>
>>     # dig @127.0.0.1
>> 'web_client\;*\;athena\;*.keys.redis.sophia.m3047' txt +notcp | tail
>> [...]
>>     ;; SERVER: 127.0.0.1#53(127.0.0.1) (TCP)
>>
>>     # dig @127.0.0.1
>> 'web_client\;*\;athena\;*.keys.redis.sophia.m3047' txt +ignore | tail
>> [...]
>>     ;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP)
>>
>> The "tell" is that on the footer SERVER line it reports the protocol.
>> Note that in the first case it's TCP, even though +notcp was
>> specified. (The MSG SIZE is also a clue.)
>>
> If you have a specific proposal for docs we would be happy to improve
> the dig man page.

First off, the parenthetical reflecting the protocol would appear to be
relatively new (that's DiG 9.18.9). It's not in 9.12. So props for that.
(That's what reminded me of why I was reflexively firing up tcpdump
during testing and made me go looking. Unfortunately it's a little bit
late to choose a different mnemonic than "ignore". Most concepts are
more readily accessible if they are part of a mythology or story. I
don't have a good story for what is being ignored, doesn't seem to me
that if I expect UDP and don't get it because TCP=1 that I'm in any
manner trying to "ignore" it. I note that there is no +udp option.)

Are you aware that if +tcp is specified along with +ignore, then +ignore
is ignored? This behavior is not dependent on the ordering of the
options on the command line. The behavior of these two options is
demonstrably not orthogonal (not sure how it could be, although maybe it
should have been). What is the expected behavior of DiG when conflicting
directives are given?


Regarding the manpage specifically, once someone realizes there is no
such thing as +udp, they're likely to fixate on +tcp / +notcp.

>        +ignore, +noignore
>               This option ignores [or does not ignore] truncation in
> UDP responses instead of retrying with TCP. By default, TCP
>               retries are performed.
This is relatively straightforward. Doesn't say that +tcp invalidates
it, but I'm not sure that would add clarity. I suppose what's being
"ignored" here is TC=1. Might as well say so: "...ignores that the
intent of TC=1 in the DNS protocol is to force retry over TCP, which is
what DiG will do under normal circumstances.". You could add "Do not use
with +tcp, this applies strictly to the (default) UDP query mode." but
that sacrifices brevity. To me, talking about the intent makes context
the DNS protocol rather than making this about DiG.

>        +tcp, +notcp
>               This option indicates whether to use TCP when querying
> name servers.  The default behavior is to use UDP unless  a
>               type any or ixfr=N query is requested, in which case the
> default is TCP. AXFR queries always use TCP.

I think this needs to be expanded to indicate that if you don't want
TCP, use +ignore rather than +notcp: "To prevent retry over TCP when
TC=1 is returned from a UDP query, use +ignore."


Actually dig -h fares better, with even more brevity:

>                  +[no]ignore         (Don't revert to TCP for TC
> responses.)


Apologies in advance if I've generated more heat than light...

--

Fred




-- 
Visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from 
this list

ISC funds the development of this software with paid support subscriptions. 
Contact us at https://www.isc.org/contact/ for more information.


bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Reply via email to