function Deno.resolveDns
allow-net

Parameters

query: string[src]
recordType:
| "A"
| "AAAA"
| "ANAME"
| "CNAME"
| "NS"
| "PTR"
[src]
optional
options: ResolveDnsOptions
[src]

Returns

Promise<string[]>[src]

Parameters

query: string[src]
recordType: "CAA"[src]
optional
options: ResolveDnsOptions
[src]

Returns

Promise<CAARecord[]>[src]

Parameters

query: string[src]
recordType: "MX"[src]
optional
options: ResolveDnsOptions
[src]

Returns

Promise<MXRecord[]>[src]

Parameters

query: string[src]
recordType: "NAPTR"[src]
optional
options: ResolveDnsOptions
[src]

Returns

Promise<NAPTRRecord[]>[src]

Parameters

query: string[src]
recordType: "SOA"[src]
optional
options: ResolveDnsOptions
[src]

Returns

Promise<SOARecord[]>[src]

Parameters

query: string[src]
recordType: "SRV"[src]
optional
options: ResolveDnsOptions
[src]

Returns

Promise<SRVRecord[]>[src]

Parameters

query: string[src]
recordType: "TXT"[src]
optional
options: ResolveDnsOptions
[src]

Returns

Promise<string[][]>[src]

Performs DNS resolution against the given query, returning resolved records. Fails in the cases such as:

  • the query is in invalid format
  • the options have an invalid parameter, e.g. nameServer.port is beyond the range of 16-bit unsigned integer
  • timed out
const a = await Deno.resolveDns("example.com", "A");

const aaaa = await Deno.resolveDns("example.com", "AAAA", {
  nameServer: { ipAddr: "8.8.8.8", port: 53 },
});

Requires allow-net permission.

Parameters

query: string[src]
recordType: RecordType[src]
optional
options: ResolveDnsOptions
[src]

Returns

Promise<
| string[]
| CAARecord[]
| MXRecord[]
| NAPTRRecord[]
| SOARecord[]
| SRVRecord[]
| string[][]
>
[src]