@sn0w@cofe.rocks okay the plot thickens. i'm not done refactoring yet but i noticed that the package cacheable-lookup is used for DNS queries. and now look at this:
// thats how you import an EcmaScript module on the node command line 🥴
let CacheableLookup = await import('cacheable-lookup').then(x => x.default);
// this uses the same options as Foundkey uses
cache = new CacheableLookup({
maxTtl: 3600, // 1h
errorTtl: 30, // 30sec
lookup: false, // no fallback if the server returns ENOTFOUND
});
// using console.log as a callback so i can see the result
cache.lookup("cache.cofe.rocks", console.log)
and the output I get is:null 107.189.12.41 4 1706030521656 7281st argument is an error if any, so no error
2nd is the resulting address, which is IPv4 in this case.
3rd is the result address family, again v4
and then probably some TTLs or something
If using nodejs's builtin DNS resolver (which doesnt do caching):dns.lookup('cache.cofe.rocks', console.log);which givesnull 2605:6400:30:f2ff:c0fe::41 6i.e. it gives a v6 address. huh?
Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
johann150@genau.qwertqwefsday.eu's status on Wednesday, 24-Jan-2024 04:30:14 JSTJohann150