Bug 1700916

Summary: dnsmasq does not reply to non-recursive queries with local data
Product: Red Hat Enterprise Linux 8 Reporter: Petr Menšík <pemensik>
Component: dnsmasqAssignee: Petr Menšík <pemensik>
Status: CLOSED ERRATA QA Contact: Petr Dancak <pdancak>
Severity: medium Docs Contact: Katerina Nemcova <knemcova>
Priority: medium    
Version: 8.0CC: omejzlik, pdancak, pemensik, thozza
Target Milestone: rcKeywords: AutoVerified, Patch, Regression, Reproducer, TestCaseProvided
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnsmasq-2.79-9.el8 Doc Type: Bug Fix
Doc Text:
.`dnsmasq` now correctly handles the non-recursive DNS queries Previously, `dnsmasq` forwarded all the non-recursive queries to an upstream server, which led to different responses. With this update, the non-recursive queries to local known names, such as DHCP host lease names or hosts read from the `/etc/hosts` file, are handled by `dnsmasq` and are not forwarded to an upstream server. As a result, the same response as to recursive queries to known names is returned.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:02:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1743192, 1755139    

Description Petr Menšík 2019-04-17 16:05:15 UTC
Description of problem:
When checking Fedora bug #1647464, I discovered recent dnsmasq does not reply correctly to DNS queries without recursion desired bit set.

Version-Release number of selected component (if applicable):
dnsmasq-2.79-4.el8+7.x86_64

How reproducible:
always

Steps to Reproduce:
1. systemctl restart dnsmasq
2. dig @localhost +norec localhost4.localdomain4
3.

Actual results:
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-16.P2.el8 <<>> @localhost +norec localhost4.localdomain4
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 33715
;; flags: qr ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;localhost4.localdomain4.	IN	A

;; Query time: 0 msec
;; SERVER: ::1#53(::1)
;; WHEN: Wed Apr 17 17:49:28 CEST 2019
;; MSG SIZE  rcvd: 41


Expected results:
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-16.P2.el8 <<>> @localhost localhost4.localdomain4
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6018
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;localhost4.localdomain4.	IN	A

;; ANSWER SECTION:
localhost4.localdomain4. 0	IN	A	127.0.0.1

;; Query time: 0 msec
;; SERVER: ::1#53(::1)
;; WHEN: Wed Apr 17 17:49:21 CEST 2019
;; MSG SIZE  rcvd: 68


Additional info:
This issue is not present in 2.76 version in RHEL7, so it makes regression after upgrade. It can break especially setups from other recursive resolvers querying dnsmasq, because they do that always without recursion. Current dnsmasq forwards all non-recursive queries to upstream server, even when it serves correct answer with rd bit set.

Comment 19 errata-xmlrpc 2020-04-28 16:02:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1715