Skip to content
  • Michał Kępień's avatar
    Track forwarder timeouts in fetch contexts · 33350626
    Michał Kępień authored
    Since following a delegation resets most fetch context state, address
    marks (FCTX_ADDRINFO_MARK) set inside lib/dns/resolver.c are not
    preserved when a delegation is followed.  This is fine for full
    recursive resolution but when named is configured with "forward first;"
    and one of the specified forwarders times out, triggering a fallback to
    full recursive resolution, that forwarder should no longer be consulted
    at each delegation point subsequently reached within a given fetch
    context.
    
    Add a new badnstype_t enum value, badns_forwarder, and use it to mark a
    forwarder as bad when it times out in a "forward first;" configuration.
    Since the bad server list is not cleaned when a fetch context follows a
    delegation, this prevents a forwarder from being queried again after
    falling back to full recursive resolution.  Yet, as each fetch context
    maintains its own list of bad servers, this change does not cause a
    forwarder timeout to prevent that forwarder from being used by other
    fetch contexts.
    33350626