[monitoring-plugins] check_dig: takes into account the -4 and -6 switch

Jan Wagner git at monitoring-plugins.org
Wed Jul 30 15:50:08 CEST 2014


    Module: monitoring-plugins
    Branch: master
    Commit: 8d50765653f1cefa551888e6d1f1ff91151f91fa
    Author: Alexander Wittig <abgandar at gmail.com>
 Committer: Jan Wagner <waja at cyconet.org>
      Date: Mon Dec 16 13:28:21 2013 +0100
       URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=8d50765

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)

---

 plugins/check_dig.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index 8d996b0..d899b11 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");
     }
   }
 



More information about the Commits mailing list