@sn0w@cofe.rocks so after looking at different docs for a bit i think i can still force it to prefer v6 addresses by settting some options. If hints.ai_flags specifies the AI_V4MAPPED flag, and hints.ai_family was specified as AF_INET6, and no matching IPv6 addresses could be found, then return IPv4-mapped IPv6 addresses in the list pointed to by res.If you are wondering about the strange wording, thats because this is from man 3 getaddrinfo :neofox_blep:
So the plan is: Tell it that I only want v6 addresses, but if it really has to its okay if it gives me IPv4 addresses mapped to IPv6 address space (like ::ffff:127.0.0.1). Trying it out gives the expected result:
cache.lookup("cache.cofe.rocks", { family: 6, hints: dns.V4MAPPED }, console.log)givesnull 2605:6400:30:f2ff:c0fe::41 6 1706033308991 63
and this also still workscache.lookup("github.com", { family: 6, hints: dns.V4MAPPED }, console.log)givingnull ::ffff:140.82.121.4 6 1706033385512 60
Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
johann150@genau.qwertqwefsday.eu's status on Wednesday, 24-Jan-2024 04:30:11 JSTJohann150