0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-05-12 12:42:09 +00:00

replaced gethostbyname with getaddrinfo

This commit is contained in:
wungad 2017-11-22 16:49:11 +01:00
parent 3d49fc9cd5
commit a20b74c742

View file

@ -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