diff options
author | Alexander Wittig <abgandar@gmail.com> | 2013-12-16 13:28:21 +0100 |
---|---|---|
committer | Jan Wagner <waja@cyconet.org> | 2014-07-30 15:25:20 +0200 |
commit | 8d50765653f1cefa551888e6d1f1ff91151f91fa (patch) | |
tree | 7a3af198b161f25b479421ab94bb7d30b4107011 /plugins/check_dig.c | |
parent | 8c623b1a432524950050ef6f2d273a87e013dacf (diff) | |
download | monitoring-plugins-8d50765653f1cefa551888e6d1f1ff91151f91fa.tar.gz |
check_dig: takes into account the -4 and -6 switch
Fix automatic DNS server name detection to honor -4 and -6 switches
(default to 127.0.0.1 or ::1 respectively, i.e. if -6 is given ::1
is used instead of 127.0.0.1)
Diffstat (limited to 'plugins/check_dig.c')
-rw-r--r-- | plugins/check_dig.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/check_dig.c b/plugins/check_dig.c index 8d996b08..d899b119 100644 --- a/plugins/check_dig.c +++ b/plugins/check_dig.c @@ -296,7 +296,10 @@ process_arguments (int argc, char **argv) dns_server = argv[c]; } else { - dns_server = strdup ("127.0.0.1"); + if (strcmp(query_transport,"-6") == 0) + dns_server = strdup("::1"); + else + dns_server = strdup ("127.0.0.1"); } } |