Systemd/src/resolve
Tom Gundersen be808ea083 resolved: fallback to TCP if UDP fails
This is inspired by the logic in BIND [0], follow-up patches
will implement the reset of that scheme.

If we get a server error back, or if after several attempts we don't
get a reply at all, we switch from UDP to TCP for the given
server for the current and all subsequent requests. However, if
we ever successfully received a reply over UDP, we never fall
back to TCP, and once a grace-period has passed, we try to upgrade
again to using UDP. The grace-period starts off at five minutes
after the current feature level was verified and then grows
exponentially to six hours. This is to mitigate problems due
to temporary lack of network connectivity, but at the same time
avoid flooding the network with retries when the feature attempted
feature level genuinely does not work.

Note that UDP is likely much more commonly supported than TCP,
but depending on the path between the client and the server, we
may have more luck with TCP in case something is wrong. We really
do prefer UDP though, as that is much more lightweight, that is
why TCP is only the last resort.

[0]: <https://kb.isc.org/article/AA-01219/0/Refinements-to-EDNS-fallback-behavior-can-cause-different-outcomes-in-Recursive-Servers.html>
2015-11-27 01:35:33 +01:00
..
.gitignore resolve: add more record types and convert to gperf table 2014-08-03 22:02:32 -04:00
Makefile resolved: add daemon to manage resolv.conf 2014-05-19 18:14:56 +02:00
dns-type.c treewide: fix typos 2015-07-29 12:29:46 +02:00
dns-type.h resolved: rr - ignore pseudo types in NSEC(3) bitmaps 2015-07-23 18:06:50 +02:00
org.freedesktop.resolve1.conf resolved: add legacy dbus service and policy files 2014-07-16 03:41:39 +02:00
org.freedesktop.resolve1.service resolved: add legacy dbus service and policy files 2014-07-16 03:41:39 +02:00
resolved-bus.c resolved: fix build 2015-11-27 00:10:29 +01:00
resolved-bus.h resolved: rename resolved.h to resolved-manager.h 2014-08-01 16:14:59 +02:00
resolved-conf.c resolved: unify DnsServer handling code between Link and Manager 2015-11-25 21:58:38 +01:00
resolved-conf.h resolved: add a generic DnsSearchDomain concept 2015-11-25 21:58:38 +01:00
resolved-def.h resolved: change query flag definitions 2015-11-27 00:03:39 +01:00
resolved-dns-answer.c resolved: fully support DNS search domains 2015-11-25 21:59:16 +01:00
resolved-dns-answer.h resolved: fully support DNS search domains 2015-11-25 21:59:16 +01:00
resolved-dns-cache.c resolved: implement client-side DNAME resolution 2015-11-24 00:20:39 +01:00
resolved-dns-cache.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
resolved-dns-packet.c Merge pull request #2031 from poettering/resolved-search-domains 2015-11-26 23:58:45 +01:00
resolved-dns-packet.h resolved: never cache RRs originating from localhost 2015-11-27 00:46:51 +01:00
resolved-dns-query.c resolved: don't follow the global search list on local scopes 2015-11-27 00:06:19 +01:00
resolved-dns-query.h resolved: store just the DnsAnswer instead of a DnsPacket as answer in DnsTransaction objects 2015-11-27 00:03:39 +01:00
resolved-dns-question.c resolved: fully support DNS search domains 2015-11-25 21:59:16 +01:00
resolved-dns-question.h resolved: fully support DNS search domains 2015-11-25 21:59:16 +01:00
resolved-dns-rr.c dns-domain: simplify dns_name_is_root() and dns_name_is_single_label() 2015-11-25 22:00:07 +01:00
resolved-dns-rr.h resolved: fully support DNS search domains 2015-11-25 21:59:16 +01:00
resolved-dns-scope.c resolved: fallback to TCP if UDP fails 2015-11-27 01:35:33 +01:00
resolved-dns-scope.h resolved: handle properly if there are multiple transactions for the same key per scope 2015-11-27 00:03:39 +01:00
resolved-dns-search-domain.c dns-domain: simplify dns_name_is_root() and dns_name_is_single_label() 2015-11-25 22:00:07 +01:00
resolved-dns-search-domain.h resolved: fully support DNS search domains 2015-11-25 21:59:16 +01:00
resolved-dns-server.c resolved: fallback to TCP if UDP fails 2015-11-27 01:35:33 +01:00
resolved-dns-server.h resolved: fallback to TCP if UDP fails 2015-11-27 01:35:33 +01:00
resolved-dns-stream.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
resolved-dns-stream.h remove unused includes 2015-02-23 23:53:42 +01:00
resolved-dns-transaction.c resolved: fallback to TCP if UDP fails 2015-11-27 01:35:33 +01:00
resolved-dns-transaction.h resolved: fallback to TCP if UDP fails 2015-11-27 01:35:33 +01:00
resolved-dns-zone.c resolved: fully support DNS search domains 2015-11-25 21:59:16 +01:00
resolved-dns-zone.h Merge pull request #1947 from phomes/sort-includes2 2015-11-19 23:32:30 +01:00
resolved-gperf.gperf resolved: add a generic DnsSearchDomain concept 2015-11-25 21:58:38 +01:00
resolved-link.c resolved: unify DnsServer handling code between Link and Manager 2015-11-25 21:58:38 +01:00
resolved-link.h resolved: enforce a maximum limit on both dns servers and search domains 2015-11-25 21:58:38 +01:00
resolved-llmnr.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
resolved-llmnr.h resolved: use a #define for LLMNR port 2015-07-13 11:28:29 -04:00
resolved-manager.c dns-domain: rework dns_label_escape() to not imply memory allocation 2015-11-25 22:00:07 +01:00
resolved-manager.h resolved: split out calls to compile full list of dns servers and search domains 2015-11-25 21:58:38 +01:00
resolved-resolv-conf.c resolved: flush the global DNS cache if /etc/resolv.conf is touched 2015-11-27 00:46:51 +01:00
resolved-resolv-conf.h resolved: split out all code dealing with /etc/resolv.conf into its own .c file 2015-11-25 21:58:37 +01:00
resolved.c resolved: make sure FallbackDNS= overrides built-in servers, doesn't extend them 2015-11-25 21:58:37 +01:00
resolved.conf.in resolved: add a generic DnsSearchDomain concept 2015-11-25 21:58:38 +01:00