With this functionality it is possible to either lookup the (IPv4) address of the given hostname or lookup the name of the given address.
For address lookup DNS over HTTP (DoH) is used. For name lookup the cached name (from the address lookup) is used. There are some API's for doing name lookups, but these are not standardised like DoH and/or require a payed subscription. Therefore chosen for simple solution assuming lookups are always done for addresses resolved earlier in the process. If an unknown address is provided, the dotted decimal name is answered (ie '104.24.23.6').
With this functionality it is possible to either lookup the (IPv4) address of the given hostname or lookup the name of the given address.
For address lookup DNS over HTTP (DoH) is used. For name lookup the cached name (from the address lookup) is used. There are some API's for doing name lookups, but these are not standardised like DoH and/or require a payed subscription. Therefore chosen for simple solution assuming lookups are always done for addresses resolved earlier in the process. If an unknown address is provided, the dotted decimal name is answered (ie
'104.24.23.6'
).Quad9 (IP 9.9.9.9) is used as server for DoH because it seems to take privacy of users serious. Other servers can be found at https://en.wikipedia.org/wiki/Public_recursive_name_server
Example (tested on Cuis and Squeak):