Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Deno.resolveDns

function resolveDns(
query: string,
recordType:
| "A"
| "AAAA"
| "ANAME"
| "CNAME"
| "NS"
| "PTR"
,
): Promise<string[]>;
function resolveDns(
query: string,
recordType: "CAA",
): Promise<CAARecord[]>;
function resolveDns(
query: string,
recordType: "MX",
): Promise<MXRecord[]>;
function resolveDns(
query: string,
recordType: "NAPTR",
): Promise<NAPTRRecord[]>;
function resolveDns(
query: string,
recordType: "SOA",
): Promise<SOARecord[]>;
function resolveDns(
query: string,
recordType: "SRV",
): Promise<SRVRecord[]>;
function resolveDns(
query: string,
recordType: "TXT",
): Promise<string[][]>;
function resolveDns(
query: string,
recordType: RecordType,
): Promise<string[] | CAARecord[] | MXRecord[] | NAPTRRecord[] | SOARecord[] | SRVRecord[] | string[][]>;
§
resolveDns(query: string, recordType: "A" | "AAAA" | "ANAME" | "CNAME" | "NS" | "PTR", options?: ResolveDnsOptions): Promise<string[]>
[src]

§Parameters

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

§Return Type

§
Promise<string[]>
[src]
§
resolveDns(query: string, recordType: "CAA", options?: ResolveDnsOptions): Promise<CAARecord[]>
[src]

§Parameters

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

§Return Type

§
Promise<CAARecord[]>
[src]
§
resolveDns(query: string, recordType: "MX", options?: ResolveDnsOptions): Promise<MXRecord[]>
[src]

§Parameters

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

§Return Type

§
Promise<MXRecord[]>
[src]
§
resolveDns(query: string, recordType: "NAPTR", options?: ResolveDnsOptions): Promise<NAPTRRecord[]>
[src]

§Parameters

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

§Return Type

§
resolveDns(query: string, recordType: "SOA", options?: ResolveDnsOptions): Promise<SOARecord[]>
[src]

§Parameters

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

§Return Type

§
Promise<SOARecord[]>
[src]
§
resolveDns(query: string, recordType: "SRV", options?: ResolveDnsOptions): Promise<SRVRecord[]>
[src]

§Parameters

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

§Return Type

§
Promise<SRVRecord[]>
[src]
§
resolveDns(query: string, recordType: "TXT", options?: ResolveDnsOptions): Promise<string[][]>
[src]

§Parameters

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

§Return Type

§
Promise<string[][]>
[src]
§
resolveDns(query: string, recordType: RecordType, options?: ResolveDnsOptions): Promise<string[] | CAARecord[] | MXRecord[] | NAPTRRecord[] | SOARecord[] | SRVRecord[] | 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]
§
options?: ResolveDnsOptions optional
[src]

§Return Type

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