[Bug 1668771] Re: [SRU] systemd-resolved negative caching for extended period of time
Launchpad Bug Tracker
1668771 at bugs.launchpad.net
Mon Nov 25 10:55:23 UTC 2019
This bug was fixed in the package systemd - 242-7ubuntu3.2
---------------
systemd (242-7ubuntu3.2) eoan; urgency=medium
[ Dan Streetman ]
* d/extra/dhclient-enter-resolved-hook:
- Replace use of bash-only &> with > and 2> (LP: #1849608)
* d/p/lp1849658-resolved-set-stream-type-during-DnsStream-creation.patch:
- Fix bug in refcounting TCP stream types (LP: #1849658)
* d/extra/dhclient-enter-resolved-hook: cleanup temp $newstate file
[ Rafael David Tinoco ]
* Add support to KeepConfiguration= fixing behaviour for HA (LP: #1815101)
- d/p/lp1815101-01-networkd-add-support-to-keep-configuration.patch
- d/p/lp1815101-02-networkd-stop-clients-when-networkd-shuts-down.patch
- d/p/lp1815101-03-network-add-KeepConfiguration-dhcp-on-stop.patch
- d/p/lp1815101-04-network-make-KeepConfiguration-static-drop-DHCP-addr.patch
- d/p/lp1815101-05-man-add-documentation-about-KeepConfiguration.patch
systemd (242-7ubuntu3.1) eoan; urgency=medium
[ Balint Reczey ]
* Fix shutdown and related actions from the login screen (LP: #1847896)
File: debian/patches/logind-consider-greeter-sessions-suitable-as-display-sess.patch
https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=b407dfd8c9dc81594553c27467c35b383333d74c
* debian/gbp.conf: Set debian-branch to ubuntu-eoan
File: debian/gbp.conf
https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=f399ce2cf4701a2dbb4b3505d2dd17a210d62f5c
[ Dan Streetman ]
* Fix bogus routes after DHCP lease change (LP: #1831787)
Files:
- debian/patches/lp1831787/0001-networkd-Add-back-static-routes-after-DHCPv4-lease-e.patch
- debian/patches/lp1831787/0002-network-set-preferred-source-in-removing-route-entry.patch
- debian/patches/lp1831787/0003-network-lower-log-level-about-critical-connection.patch
- debian/patches/lp1831787/0004-network-reset-Link-dhcp4_configured-flag-earlier.patch
- debian/patches/lp1831787/0005-network-split-dhcp_lease_lost-into-small-pieces.patch
https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=ced3f5c2f619083f7beb164d94d4ccfe52222fe8
* Set src address for dhcp 'classless' routes (LP: #1835581)
File: debian/patches/lp1835581-src-network-networkd-dhcp4.c-set-prefsrc-for-classle.patch
https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=6a7ef370fb1335548448920be4ae6176b67044a8
* Allows cache=no-negative option to be set, ignoring negative answers to
be cached (LP: #1668771)
File: debian/patches/lp1668771-resolved-switch-cache-option-to-a-tri-state-option-s.patch
https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=27def26f5b1d1b8ba314c4a925fc1b7c43837f86
-- Dan Streetman <ddstreet at canonical.com> Fri, 01 Nov 2019 16:33:08
-0400
** Changed in: systemd (Ubuntu Eoan)
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1668771
Title:
[SRU] systemd-resolved negative caching for extended period of time
Status in systemd:
New
Status in systemd package in Ubuntu:
In Progress
Status in systemd source package in Bionic:
Fix Released
Status in systemd source package in Disco:
Fix Released
Status in systemd source package in Eoan:
Fix Released
Bug description:
[Impact]
* If a DNS lookup returns SERVFAIL, systemd-resolved seems to cache
the result for very long (infinity?). I have to restart systemd-
resolved to have the negative caching purged.
* After SERVFAIL DNS server issue has been resolved, chromium/firefox
still returns DNS error despite host can correctly resolve the name.
[Test Case]
* If a lookup returns SERVFAIL systemd-resolved will cache the result for 30s (See 201d995),
however, there are several use cases on which this condition is not acceptable (See #5552 comments)
and the only workaround would be to disable cache entirely or flush it , which isn't optimal.
* Configure /etc/systemd/resolved.conf as follows:
Cache=yes (default)
* Restart systemd-resolved (systemctl restart systemd-
resolved.service)
* Run a host/getent command against a entry that will return SERVFAIL
and check the journalctl output to see that the reply gets served from
cache.
root at systemd-disco:/home/ubuntu# host www.montemar.cl
Host www.montemar.cl not found: 2(SERVFAIL)
root at systemd-disco:/home/ubuntu# journalctl -u systemd-resolved -n
-- Logs begin at Fri 2019-07-12 18:09:42 UTC, end at Tue 2019-07-23 15:10:17 UTC. --
Jul 23 15:10:10 systemd-disco systemd-resolved[1282]: Transaction 6222 for <ntp.ubuntu.com IN AAAA> on scope dns on ens3/* now complete with <success>
Jul 23 15:10:10 systemd-disco systemd-resolved[1282]: Sending response packet with id 61042 on interface 1/AF_INET.
Jul 23 15:10:10 systemd-disco systemd-resolved[1282]: Freeing transaction 6222.
Jul 23 15:10:17 systemd-disco systemd-resolved[1282]: Got DNS stub UDP query packet for id 53580
Jul 23 15:10:17 systemd-disco systemd-resolved[1282]: Looking up RR for www.no-record.cl IN A.
Jul 23 15:10:17 systemd-disco systemd-resolved[1282]: RCODE SERVFAIL cache hit for www.no-record.cl IN A
Jul 23 15:10:17 systemd-disco systemd-resolved[1282]: Transaction 58570 for < www.no-record.cl IN A> on scope dns on ens3/* now complete with <rcode-fai
Jul 23 15:10:17 systemd-disco systemd-resolved[1282]: Freeing transaction 58570.
Jul 23 15:10:17 systemd-disco systemd-resolved[1282]: Sending response packet with id 53580 on interface 1/AF_INET.
Jul 23 15:10:17 systemd-disco systemd-resolved[1282]: Processing query...
[Regression Potential]
* The default options (Yes/No) will remain as default Yes, behaving in the same original
way, by setting it to no-negative any negative answer will be skipped
from being cached.
* No regression potential has been detected as this just introduces
a new possible option for the Cache configuration directive.
[Fix]
With the cache option set to 'no-negative', negative DNS answers
are entirely avoided to being cached.
root at systemd-disco:/home/ubuntu# host www.metaklass.org
Host www.metaklass.org not found: 2(SERVFAIL)
* Look at the systemd-resolved entries
root at systemd-disco:/home/ubuntu# journalctl -u systemd-resolved -n
-- Logs begin at Fri 2019-07-12 18:09:42 UTC, end at Fri 2019-07-12 18:48:31 UTC. --
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Cache miss for www.metaklass.org IN A
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Transaction 22382 for <www.metaklass.org IN A> scope dns on ens3/.
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Using feature level UDP for transaction 22382.
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Sending query packet with id 22382.
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Processing incoming packet on transaction 22382 (rcode=SERVFAIL).
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Server returned error: SERVFAIL
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Not caching negative entry for: www.metaklass.org IN A, cache mode set to no-negative
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Transaction 22382 for <www.metaklass.org IN A> on scope dns on ens3/ now complete with from network (unsigned).
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Sending response packet with id 31060 on interface 1/AF_INET.
The following patch https://github.com/systemd/systemd/pull/13047
implements the required changes.
[Other Info]
Note that systemd in Eoan is being upgraded to upstream 242, so I am
not adding this to Eoan now, as I don't want to disturb the merge. If
needed after the merge, I'll add to Eoan.
To manage notifications about this bug go to:
https://bugs.launchpad.net/systemd/+bug/1668771/+subscriptions
More information about the foundations-bugs
mailing list