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:
parent
3d49fc9cd5
commit
a20b74c742
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue