[linux] 域名解析失败案例定位 [Errno -2] Name or service not known
首先发现代码里这段运行报错:socket.gethostbyname_ex(host_name)Traceback(mostrecentcalllast):File“”,line1,insocket.gaierror:[Errno-2]Nameorservicenotknownimportsockethost_name=socket.gethostname()print(socket.gethos