0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-05-17 14:42:21 +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 random import choice
from threading import Thread from threading import Thread
from socket import gethostbyname, gaierror from socket import getaddrinfo, gaierror
try: try:
from time import monotonic as time from time import monotonic as time
@ -109,7 +109,7 @@ def dns_request(server_list, timeout, domains):
def check_ns(ns): def check_ns(ns):
try: try:
return gethostbyname(ns) return getaddrinfo(ns, 'domain')[0][4][0]
except gaierror: except gaierror:
return False return False