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