tl;dr: Using a DNS server on a local network causes socket.getaddrinfo() to experience an error:
OS Error: [Error 103] ECONNABORTED
Using an internet DNS server works.
Details: I have a very simple program which does a socket.getaddrinfo() call:
import socket
host = 'google.com'
port = 443
addr_info = socket.getaddrinfo(host, port)
print('addr_info:', addr_info)
The ESP8266 on which this runs (an ESP-12F) gets its IP address served by DHCP.
When the local DHCP server is set up to deliver an IP address block as follows, the code above works just fine:
IP address: 192.168.X.X
Router: 192.168.X.Y
DNS server: **8.8.8.8**
When the local DHCP server is set up to deliver this IP address block, the code above fails with the ECONNABORTED error:
IP address: 192.168.X.X
Router: 192.168.X.Y
DNS: **192.168.X.X**
(Note that, yes, the router is also the DNS server. It does recursive DNS, using the upstream DNS servers provider by my ISP. This DNS server setup works for all other cases)
I know the WiFi connection is up at the time this program is run, and has internet access.
I have done a network packet trace to see if the ESP8266 is sending any data. It does send data when the 8.8.8.8 DNS server is used; it does not send any data when the 192.168.X.X DNS server is used.
Basically, by all failure characteristics, this seems to be a problem in the Micropython socket module for the getaddrinfo class.
Has anyone else seen this problem? Or know how to delve further into the bowels of the Micropython beast to figure it out?