socket.gaierror assumes that Python cannot run getaddrinfo() or getnameinfo() . In your case, this is most likely the first. This function accepts the host and port and returns a list of tuples with information on how to connect to the host. If you specify a host name for this function, try resolving the IP address deeper below.
So, the error should come from the fact that Python will not be able to resolve the address you wrote ( yun.local ) to a valid IP address. I suggest you look at /etc/hosts on the device to see if it is defined there. You can also try using command line tools like host or telnet to check the resolution:
For instance:
[ pugo@q-bert ~]$ telnet localhost 80 Trying ::1... Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused
There he managed to resolve my localhost to ::1 (IPv6) and 127.0.0.1 (IPv4), because it exists in /etc/resolv.conf . If I try with your host:
[ pugo@q-bert ~]$ telnet yun.local 80 telnet: could not resolve yun.local/80: Name or service not known
source share