RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1469546 - dns becomes slow after running for a few days
Summary: dns becomes slow after running for a few days
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: dnsmasq
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Petr Menšík
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-11 13:25 UTC by Gerd Hoffmann
Modified: 2017-08-01 02:28 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 02:28:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Gerd Hoffmann 2017-07-11 13:25:35 UTC
Description of problem:
dns becomes slow after running for a few days

Version-Release number of selected component (if applicable):
dnsmasq-2.76-2.el7.x86_64

How reproducible:
100%

I'm running "RHEL-7 Workstation" on my machine, with NetworkManager configured to use dnsmasq for split-dns configuration.  Works fine for a few days, but then DNS becomes very slow and dnsmasq fills the log with "Maximum number of concurrent DNS queries reached" messages.

Comment 3 Petr Menšík 2017-07-25 15:49:21 UTC
Hi Gerd, thanks for your report. Can you please share your configuration?

You can increase maximum concurrent queries by dns-forward-max=300 directive. Each query should be freed after 40 seconds. If your workstation time does not go backwards, it should appear only for short time.

Can you please check by tcpdump or similar that queries are not made in high numbers?

Can you try sending 
$ killall -s USR1 dnsmasq

and include its output from journalctl? Before lags and after they start if possible?

Comment 8 Petr Menšík 2017-07-28 17:46:12 UTC
I think I have found a fix that would work.

Summary from private comments is this:
main dnsmasq instance listening on localhost uses forwarders for specific domains. One of that domains is forwarded to libvirt (another) dnsmasq instance handling names of virtual machines. Known hosts work well. However unknown names are forwarded back to the system forwarder. Which is dnsmasq listening on localhost. That forwards it again to libvirt instance, creating unending loop.

localhost configuration includes something like:
server=/sirius.example.org/192.168.105.1
rev-server=192.168.105.0/24,192.168.105.1

on 192.168.105.1 is listening dnsmasq instance of libvirt.

You want to prevent looping of unhandled dns names back. I think it you can fix it by change of libvirt configuration.

edit libvirt network definition by
$ virsh net-edit default

then add into tag <network> (not <ip>) something like this:
  <dns>
    <forwarder addr='127.0.0.1'/>
    <forwarder domain='sirius.example.org'/>
    <forwarder domain='105.168.192.in-addr.arpa'/>
  </dns>

that would forward all queries to localhost instance, but do not forward anything from domains without addr. Registered hosts would be correctly handled, others would receive correct answer NXDOMAIN from dnsmasq of libvirt.

Comment 9 Laine Stump 2017-08-01 02:28:47 UTC
I haven't checked if Petr's suggestion will work, but jdenemar solved this in his similar setup by adding the "localPtr" attribute to libvirt networks' <ip> element. For example:

   <ip address='192.168.105.0' netmask='255.255.255.0' localPtr='yes''/>

dnsmasq only responds to PTR record requests for ip addresses that are *currently assigned to a client* and will normally forward requests for currently unassigned addresses to the upstream DNS server. But when localPtr is yes for an address range, it will respond with a failure rather than forwarding the request upstream. This behavior is achieved by libvirt adding (in the case of the above example) the following to the dnsmasq.conf file:

   local=/105.168.192.in-addr.arpa/

Whenever you have the upstream DNS server on the host setup to potentially forward to a libvirt network's DNS, you should always add localPtr='yes' to the libvirt network's <ip> elements (and also add "localOnly='yes'" to any <domain> element defined in the network).

I'm assuming that making these changes to your network will solve the problem, and closing this as NOTABUG. If the problem persists, then please re-open.


Note You need to log in before you can comment on or make changes to this bug.