diff options
author | Yusuke Tanaka <yusuktan@maguro.dev> | 2021-01-19 23:39:04 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 09:39:04 -0500 |
commit | 0ef8c915c07fa3e7c7898b467d259426144958f4 (patch) | |
tree | ba83fb5b813110e92fcb5ae634f0121d628acf0f /cli/tests/resolve_dns.ts | |
parent | cf3202644d99f57af3c1da169435f0d1cd8eadd8 (diff) |
feat(unstable): add Deno.resolveDns API (#8790)
Diffstat (limited to 'cli/tests/resolve_dns.ts')
-rw-r--r-- | cli/tests/resolve_dns.ts | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/cli/tests/resolve_dns.ts b/cli/tests/resolve_dns.ts new file mode 100644 index 000000000..35abfc803 --- /dev/null +++ b/cli/tests/resolve_dns.ts @@ -0,0 +1,36 @@ +const nameServer = { nameServer: { ipAddr: "127.0.0.1", port: 4553 } }; + +const [a, aaaa, aname, cname, mx, ptr, srv, txt] = await Promise.all([ + Deno.resolveDns("www.example.com", "A", nameServer), + Deno.resolveDns("www.example.com", "AAAA", nameServer), + Deno.resolveDns("www.example.com", "ANAME", nameServer), + Deno.resolveDns("foo", "CNAME", nameServer), + Deno.resolveDns("www.example.com", "MX", nameServer), + Deno.resolveDns("5.6.7.8", "PTR", nameServer), + Deno.resolveDns("_Service._TCP.example.com", "SRV", nameServer), + Deno.resolveDns("www.example.com", "TXT", nameServer), +]); + +console.log("A"); +console.log(JSON.stringify(a)); + +console.log("AAAA"); +console.log(JSON.stringify(aaaa)); + +console.log("ANAME"); +console.log(JSON.stringify(aname)); + +console.log("CNAME"); +console.log(JSON.stringify(cname)); + +console.log("MX"); +console.log(JSON.stringify(mx)); + +console.log("PTR"); +console.log(JSON.stringify(ptr)); + +console.log("SRV"); +console.log(JSON.stringify(srv)); + +console.log("TXT"); +console.log(JSON.stringify(txt)); |