unbound asks for A record, when txt requested

Hello,

I found a strange behavior with unbound 1.6.0 as resolver. When I send a
request for a "TXT" record unbound first asks for a "A" record.

Normally this is not a problem, but we now have a problem with a DNS server
which only answers to "TXT" records. When you ask for a "A" record you
get no response and you have to wait for the timeout.

Here is an example:
DNS-Name: urvfr.qr.m.05.s.sophosxl.net
authoritative name server for m.05.s.sophosxl.net: ns.sxl31.sophosxl.net.
DNS-IP1: 34.252.84.252
DNS-IP2: 52.19.19.59

Unbound tries to fetch the "A" records from both nameserver and runs into
a timeout and after the timeout there is the "TXT" record request.
12:01:31.279241 34.252.84.252.53: 19073% [1au] A? urvfr.qr.m.05.s.sophosxl.net. (57)
12:01:31.329441 34.252.84.252.53: 49899% [1au] A? urvfr.qr.m.05.s.sophosxl.net. (57)
12:01:31.430434 52.19.19.59.53: 55169% [1au] A? urvfr.qr.m.05.s.sophosxl.net. (57)
12:01:31.530833 52.19.19.59.53: 20653% [1au] A? urvfr.qr.m.05.s.sophosxl.net. (57)
12:01:31.731961 34.252.84.252.53: 18091% [1au] A? urvfr.qr.m.05.s.sophosxl.net. (57)
12:01:32.132984 34.252.84.252.53: 54968% [1au] A? urvfr.qr.m.05.s.sophosxl.net. (57)
12:01:32.933638 52.19.19.59.53: 1330% [1au] TXT? urvfr.qr.m.05.s.sophosxl.net. (57)
12:01:32.963046 52.19.19.59.53: 47544% [1au] TXT? urvfr.qr.m.05.s.sophosxl.net. (57)
12:01:32.994500 52.19.19.59.53: 9287% [1au] TXT? urvfr.qr.m.05.s.sophosxl.net. (57)
12:01:33.026025 52.19.19.59.53: 28622% [1au] TXT? urvfr.qr.m.05.s.sophosxl.net. (57)
12:01:33.057624 34.252.84.252.53: 8529% [1au] TXT? urvfr.qr.m.05.s.sophosxl.net. (57)
12:01:33.088539 34.252.84.252.53: 30851% [1au] TXT? urvfr.qr.m.05.s.sophosxl.net. (57)

Because the TTL for the entry is only 10 seconds this problems happens very
often. Also the part before m.05.s.sophosxl.net is dynamic.

This is used by some kind of sophos endpoint protection. The client sends
several request for each website he tries to reach. So this endsup in a total
wait time of 60 seconds for every website the client tries to reach.

Here is the config:
server:
   # localhost
   access-control: 127.0.0.0/8 allow
   access-control: 192.168.0.0/16 allow
   access-control: 172.16.0.0/12 allow
   access-control: 10.0.0.0/8 allow
   hide-identity: yes
   hide-version: yes
   minimal-responses: yes
   prefetch: yes
   qname-minimisation: yes
   rrset-roundrobin: yes
   use-caps-for-id: yes
   verbosity: 1
   cache-max-negative-ttl: 300

Can I change this behavior or is this fixed in a newer version?

I can provide captures if needed.

Best regards,

Oliver

I found a strange behavior with unbound 1.6.0 as resolver. When
I send a request for a "TXT" record unbound first asks for a
"A" record.

That is indeed a little strange.

Normally this is not a problem, but we now have a problem with
a DNS server which only answers to "TXT" records. When you ask
for a "A" record you get no response and you have to wait for
the timeout.

I hope there is no disagreement that this is Utterly Broken
Behaviour. The correct thing to do would be to send a NODATA
response if there is a TXT record or other record types attached
to the queried-for name.

Best regards,

- Håvard

server:

qname-minimisation: yes

“qname-minimisation: no” will improve query time. qname-minimisation generates lot of queries not identical to original query.

I believe that there is no standard (all DNS responders must be compliant to it) saying that authoritative servers must respond to all well-formed queries, so I don’t blame Sophos’ servers.

There is this draft in the works:

https://tools.ietf.org/html/draft-ietf-dnsop-no-response-issue

Sophos's server can totally be blamed for being appallingly half-arsed.

Tony.

There is this draft in the works:

https://tools.ietf.org/html/draft-ietf-dnsop-no-response-issue

I fully agree content of the document, but we can’t expect that all implementers strictly follow an I-D that its intended status is BCP.

FWIW, this behavior is essentially against the “expected behavior”
described in RFC4074, too. One can still say that it’s just an
informational RFC without an RFC2119 keyword. But in that sense “we
can’t expect that all implementers strictly follow XXX”, whether XXX
is an individual draft, a non-standards-track RFC, a standards-track
RFC without RFC2119 keywords, or a standards-track RFC with a bunch of
RFC2119 keywords. After all, there’s no protocol police, and there’s
always a broken implementation whatever the standard says.

It’s still nice to have something to show to protocol abusers. It
doesn’t always work, but often does.

I apologize in advance for the disclaimer that gets attached to my
outbound email..

:stuck_out_tongue:

tl;dr: Unbound is fine, it's Sophos..

We also have Sophos here, and sophos does a txt lookup for each url
your users are visiting.

It's some sort of 'web filter' option on Sophos..

my 0.02

I find Sophos to be a terrible product for us.. I can't recall it
actually stopping anything or being able to clean anything..

This is how I dealt with that..

local-zone: "sophosxl.net" refuse
local-data: 'sophosxl.net. TXT "Served from 10.20.8.29"'

https://glot.io/snippets/ffx5lfimnp

unbound logs @glot

host -t txt 3.1o19sr00n1360n34p37499pqr8o552qs855pq81p68713n35r649770nq4qp5n2.116p5r741p936393648s247p01n84noqq0oq6s5r26o4r40022qs29603rro0n7.r9074nqr24s1qo654o3pp76q82922p07np.nr1p4618o93s63o3or8r812008np292oqr505169.i.00.s.sophosxl.net.
9.9.9.9

gives an answer..

"x c"

ymmv

This is misunderstanding! draft-ietf-dnsop-no-response-issue simply points out common non-compliance, it does not change the DNS protocol in any significant way.

Responding to well-formed queries is the very basic of DNS protocol - there is no such thing as "ignore query" in the very basic DNS resolution algorithm as standardized in RFC 1034:
https://tools.ietf.org/html/rfc1034#section-4.3.2

Any implementation which is unable to respond to well-formed queries is just broken and there is no excuse for it.

in DNS RRL (www.redbarn.org/dns/ratelimits) a motive and a method is described whereby queries which appear to be uselessly duplicative are dropped without response. this is the main method of managed nonparticipation in DNS-amplified DDoS attacks.

perhaps this is exempted from your otherwise broad statement, since the implementation of DNS RRL does not render an implementation "unable" to respond to all well-formed queries, but rather, "unwilling" to do so.

DDoS is a special case, of course.