mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-22 14:46:57 -04:00
ignore CNAMEs in RDNS-mode #1460
Suppose your provider uses RFC 2317 (or RFC 4183 for that matter). The output of nslookup could look like the following: 2.120.22.172.in-addr.arpa canonical name = 2.0/26.120.22.172.in-addr.arpa. 2.0/26.120.22.172.in-addr.arpa name = rajesh.intern.prauscher.de. Without this filter, check_dns would check the string against "2.0/26.120.22.172.in-addr.arpa., rajesh.intern.prauscher.de." which will fail for obvious reasons. In forward DNS, this is achieved in line 165, as nslookup will print the address separate from the CNAME-resolving. Original commit by Patrick Rauscher (prauscher@prauscher.de), adapted here.
This commit is contained in:
parent
8a415c3c09
commit
16cb24807d
1 changed files with 3 additions and 0 deletions
|
|
@ -128,6 +128,9 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
if (strcasestr(chld_out.line[i], ".in-addr.arpa") || strcasestr(chld_out.line[i], ".ip6.arpa")) {
|
||||
if ((strstr(chld_out.line[i], "canonical name = ") != NULL)) {
|
||||
continue;
|
||||
}
|
||||
char *temp_buffer = NULL;
|
||||
if ((temp_buffer = strstr(chld_out.line[i], "name = "))) {
|
||||
addresses[n_addresses++] = strdup(temp_buffer + 7);
|
||||
|
|
|
|||
Loading…
Reference in a new issue