(🌊 client-side dns query: using fetch.then.catch to an online dns-api to get dns info about a node.)

🚧 🏗 ok I wrote this week-end in order to get information for a template landing page for my sites done at in Kajiki, Japan (Asia) on 2019-10-06. 〜 michelc

<span id=dnsresp></span>
<script src=/js/dns.js></script>
<script>
/* your "callback" code here ... */
</script>

callback code example :

DNS.Query('iph.heliohost.org','ANY', callback('dnsresp'))

function callback(id) {
   var display = function(json) {
   console.log(json);
   var rr = json.rr
   var buf = '<br>'+json.query.domain+' ('+json['status']+') #'+rr.length+'\n<ol>'
   for(let i=0; i<rr.length; i++) {
      buf += '<li>'+rr[i]['plain']
   }
   buf += '</ol>'
   document.getElementById(id).innerHTML = buf;
   }
   return display
}

code : http://127.0.0.1:8088/repositories/helio/test/jsondns.htm (script: dns.js)
demo : http://127.0.0.1:8088/repositories/helio/test/

– 
∿aroksay-uputnay on 2019-10-06 at 14:17:13 – mgc