forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
bugespressifapplies to multiple Espressif chipsapplies to multiple Espressif chipsnetworkthird-partyAwaiting action on a third party for a fix or an answer to a requestAwaiting action on a third party for a fix or an answer to a request
Milestone
Description
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.1-25-gec855a2b1 on 2022-10-10; Adafruit Feather ESP32-S2 TFT with ESP32S2
Adafruit CircuitPython 8.0.0-beta.1-20-g66f84f5f9 on 2022-10-07; Raspberry Pi Pico W with rp2040Code/REPL
import socketpool
import wifi
import ipaddress
from secrets import secrets
HOSTS = ("adafruit.com", "adafruit.com.", "circuitpython.local", "circuitpython.local.",)
pool = socketpool.SocketPool(wifi.radio)
wifi.radio.connect(secrets["ssid"], secrets["password"])
for host in HOSTS:
try:
print(f"{ipaddress.ip_address(pool.getaddrinfo(host, 443)[0][4][0])}")
except Exception as e:
print(f"{e}")Behavior
espressif:
Adafruit CircuitPython 8.0.0-beta.1-25-gec855a2b1 on 2022-10-10; Adafruit Feather ESP32-S2 TFT with ESP32S2
>>> import code
104.20.38.240
-2
192.168.6.196
-2
raspberrypi:
Adafruit CircuitPython 8.0.0-beta.1-20-g66f84f5f9 on 2022-10-07; Raspberry Pi Pico W with rp2040
>>> import code
104.20.38.240
104.20.38.240
[Errno 2] No such file/directory
[Errno 2] No such file/directory
Description
espressif resolves typical DNS (and mDNS) relative domain names., but does not resolve any FQDNs with the final dot.
raspberrypi resolves typical DNS relative domain names, and DNS FQDNs with the final dot.
Additional information
See: Multicast DNS
Most computer users neglect to type the trailing dot at the end of a fully qualified domain name, making it a relative domain name
This is probably not a significant issue in the big scheme of things. There may be occasions where FQDNs are linked or cut-and-pasted from a browser for use in CircuitPython code, and the final dot is easy to overlook. I mainly wanted to document this in case someone is poking in those areas of the code at some point.
Metadata
Metadata
Assignees
Labels
bugespressifapplies to multiple Espressif chipsapplies to multiple Espressif chipsnetworkthird-partyAwaiting action on a third party for a fix or an answer to a requestAwaiting action on a third party for a fix or an answer to a request