[Asterisk-code-review] Add a negative DNS cache (asterisk[master])

Kevin Harwell asteriskteam at digium.com
Tue Nov 24 14:57:53 CST 2015


Kevin Harwell has uploaded a new patch set (#2).

Change subject: Add a negative DNS cache
......................................................................

Add a negative DNS cache

This patch currently implements an extremely simplified negative cache.
Meaning it keeps track of instances when the domain name failed to resolve.

Domains attempting to resolve should first look in the cache to see if a given
domain is contained within. If a matching, non-expired entry is found then
domain name resolution should be skipped with a failure assumed. If the domain
is not found, or the entry has expired then an attempt should made to resolve
it. If it fails to resolve the domain name should then be added to the cache.

Subsequent failures when resolving the domain name should update the matching
entry, thus doubling its expiration timeout.

A background task also executes every so often to check for stale records.
A stale record is a cache entry that has expired, but has not been updated
for a given interval. Any stale records found are removed from the cache.

A couple of CLI commands have also been added:

    'dns cache show' - Display all entries in the cache
    'dns cache delete [all]|<name>' - Remove all entries or a single one by name

ASTERISK-25570 #close

Change-Id: Icb9f8c7ec15eedd4701461bf865e8036a5732388
---
M include/asterisk/_private.h
A include/asterisk/dns_cache.h
M main/asterisk.c
A main/dns_cache.c
M main/dns_core.c
M main/netsock2.c
6 files changed, 525 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/10/1710/2
-- 
To view, visit https://gerrit.asterisk.org/1710
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Icb9f8c7ec15eedd4701461bf865e8036a5732388
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-code-review mailing list