DNS: Create a system-level DNS resolver

Prior to this patch, the DNS core present in master had no default system-level
resolver implementation. Therefore, it was not possible for the DNS core to
perform resolutions unless the libunbound library was installed and the
res_resolver_unbound module was loaded.

This patch introduces a system-level DNS resolver implementation that will
register itself with the lowest consideration priority available (to ensure
that it is to be used only as a last resort). The resolver relies on low-level
DNS search functions to perform a rudimentary DNS search based on a provided
query and then supplies the search results to the DNS core.

ASTERISK-25146 #close
Reported By: Joshua Colp

Change-Id: I3b36ea17b889a98df4f8d80d50bb7ee175afa077
This commit is contained in:
Ashley Sanders
2015-07-07 15:03:34 -05:00
parent c12ace3ab3
commit 3cdfd39af7
5 changed files with 628 additions and 23 deletions

View File

@@ -4511,6 +4511,11 @@ int main(int argc, char *argv[])
exit(1);
}
if (ast_dns_system_resolver_init()) { /* Initialize the default DNS resolver */
printf("Failed: ast_dns_system_resolver_init\n%s", term_quit());
exit(1);
}
if ((moduleresult = load_modules(1))) { /* Load modules, pre-load only */
printf("Failed: load_modules\n%s", term_quit());
exit(moduleresult == -2 ? 2 : 1);