Description of problem: dnsmasq is not able to deliver response to client, if configured upstream forwarder replies just with status code and no QNAME section present. Unbound 1.6.6 sends such reply, when non-recursive query is sent to it. If dnsmasq is forwarding to it, it will not deliver SERVFAIL or original response, it would just timeout. Version-Release number of selected component (if applicable): dnsmasq-2.80-13.fc30.x86_64 How reproducible: always Steps to Reproduce: 1. configure forwarder to reply without qname, reply size 12 2. set dnsmasq --server=[forwarder-ip] 3. dig @[dnsmasq-ip] some.example.com Actual results: ; <<>> DiG 9.16.2-RedHat-9.16.2-1.fc30 <<>> -p 5354 @127.0.0.1 +norec nx.example.com ; (1 server found) ;; global options: +cmd ;; connection timed out; no servers could be reached Expected results: status: SERVFAIL or exact response from the server Additional info:
Created attachment 1680830 [details] basic reproducer script On localhost, unbound is supposed to run. When it replies without qname in response, this dig in this script timeouts. It should receive at least SERVFAIL. Alternative would be ldns-utils package. cat > testns << TESTNS $TTL 600 ENTRY_BEGIN MATCH #nx.test REPLY SERVFAIL QR ADJUST copy_id ENTRY_END TESTNS ldns-testns testns Then run this script
Unbound 1.6.6 from RHEL/CentOS 7 would return REFUSED when dig +norec is directed at default configuration. That reply is without qname. Qname was fixed in unbound 1.7.0, later versions answers are properly forwarded.
Created attachment 1680836 [details] all-on-one-test.sh Updated reproducer, starting also ldns-testns on test. It provides complete check if dnsmasq is able to handle replies without qname.
Reply without qname looks like this in DiG: $ dig -p 8054 test ; <<>> DiG 9.16.2-RedHat-9.16.2-1.fc30 <<>> -p 8054 test ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 29465 ;; flags: qr; QUERY: 0, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 ;; Query time: 0 msec ;; SERVER: 127.0.0.1#8054(127.0.0.1) ;; WHEN: St dub 22 13:39:36 CEST 2020 ;; MSG SIZE rcvd: 12
Created attachment 1680837 [details] Candidate patch
Reported on http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q3/014206.html
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle. Changing version to 33.
This message is a reminder that Fedora 33 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '33'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 33 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 33 changed to end-of-life (EOL) status on 2021-11-30. Fedora 33 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.