From 2aa3bb6c00fa4a86680622e714f818b46962155d Mon Sep 17 00:00:00 2001 From: vin01 <30344579+vin01@users.noreply.github.com> Date: Fri, 2 Sep 2022 01:27:50 +0000 Subject: [PATCH] fix(utils): use getaddrinfo for hostname check to support ipv6 (#21042) --- superset/utils/network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/utils/network.py b/superset/utils/network.py index 8079a96e20..8ae08d2c01 100644 --- a/superset/utils/network.py +++ b/superset/utils/network.py @@ -44,7 +44,7 @@ def is_hostname_valid(host: str) -> bool: Test if a given hostname can be resolved. """ try: - socket.gethostbyname(host) + socket.getaddrinfo(host, None) return True except socket.gaierror: return False