diff --git a/src/drunc/controller/interface/shell_utils.py b/src/drunc/controller/interface/shell_utils.py index 7785fc9ab..3751989c3 100644 --- a/src/drunc/controller/interface/shell_utils.py +++ b/src/drunc/controller/interface/shell_utils.py @@ -113,7 +113,10 @@ def update_endpoint(endpoint: str) -> str: ip_address = urlparse(endpoint).hostname if not ip_address: return "" - hostname, _, _ = socket.gethostbyaddr(ip_address) + try: + hostname, _, _ = socket.gethostbyaddr(ip_address) + except socket.herror: + return ip_address return endpoint.replace(ip_address, hostname) table.add_row(