diff --git a/backend/routers/discovery.py b/backend/routers/discovery.py index ecc562a..46e9e8b 100644 --- a/backend/routers/discovery.py +++ b/backend/routers/discovery.py @@ -71,7 +71,8 @@ def _ping(ip: str) -> bool: # Guard against proxy-ARP / gateway false positives: verify the ICMP # reply actually came from the target IP and not an intermediate node. stdout = r.stdout.decode(errors="ignore") - return f"from {ip}:" in stdout or f"from {ip} " in stdout + # Also handles "from hostname (ip):" format when DNS resolves the target + return f"from {ip}:" in stdout or f"from {ip} " in stdout or f"({ip}):" in stdout except Exception: return False