Browse Source

replaced gethostbyname with getaddrinfo

wungad 7 years ago
parent
commit
a20b74c742
1 changed files with 2 additions and 2 deletions
  1. 2 2
      python.d/dns_query_time.chart.py

+ 2 - 2
python.d/dns_query_time.chart.py

@@ -4,7 +4,7 @@
 
 from random import choice
 from threading import Thread
-from socket import gethostbyname, gaierror
+from socket import getaddrinfo, gaierror
 
 try:
     from time import monotonic as time
@@ -109,7 +109,7 @@ def dns_request(server_list, timeout, domains):
 
 def check_ns(ns):
     try:
-        return gethostbyname(ns)
+        return getaddrinfo(ns, 'domain')[0][4][0]
     except gaierror:
         return False