1 |
|
2 |
|
3 |
|
4 | import {
|
5 | AnyRecord,
|
6 | LookupAddress,
|
7 | LookupAllOptions,
|
8 | LookupOneOptions,
|
9 | LookupOptions,
|
10 | MxRecord,
|
11 | NaptrRecord,
|
12 | RecordWithTtl,
|
13 | ResolveOptions,
|
14 | ResolveWithTtlOptions,
|
15 | SoaRecord,
|
16 | SrvRecord,
|
17 | } from "dns";
|
18 | export * from "dns";
|
19 |
|
20 |
|
21 | export function lookup(
|
22 | hostname: string,
|
23 | family: number,
|
24 | callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
|
25 | ): void;
|
26 | export function lookup(
|
27 | hostname: string,
|
28 |
|
29 |
|
30 | options: LookupOneOptions,
|
31 | callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
|
32 | ): void;
|
33 | export function lookup(
|
34 | hostname: string,
|
35 | options: LookupAllOptions,
|
36 | callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void,
|
37 | ): void;
|
38 | export function lookup(
|
39 | hostname: string,
|
40 | options: LookupOptions,
|
41 | callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void,
|
42 | ): void;
|
43 | export function lookup(
|
44 | hostname: string,
|
45 | callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
|
46 | ): void;
|
47 |
|
48 | export function lookup(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
|
49 | export function lookup(hostname: string, options?: LookupOneOptions | number): Promise<[string, number]>;
|
50 | export function lookup(hostname: string, options: LookupOptions): Promise<[string, number] | LookupAddress[]>;
|
51 |
|
52 | export function lookupService(
|
53 | address: string,
|
54 | port: number,
|
55 | callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void,
|
56 | ): void;
|
57 | export function lookupService(address: string, port: number): Promise<[string, string]>;
|
58 |
|
59 |
|
60 | export function resolve(
|
61 | hostname: string,
|
62 | callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
63 | ): void;
|
64 | export function resolve(
|
65 | hostname: string,
|
66 | rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR",
|
67 | callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
68 | ): void;
|
69 | export function resolve(
|
70 | hostname: string,
|
71 | rrtype: "ANY",
|
72 | callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
|
73 | ): void;
|
74 | export function resolve(
|
75 | hostname: string,
|
76 | rrtype: "MX",
|
77 | callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
|
78 | ): void;
|
79 | export function resolve(
|
80 | hostname: string,
|
81 | rrtype: "NAPTR",
|
82 | callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
|
83 | ): void;
|
84 | export function resolve(
|
85 | hostname: string,
|
86 | rrtype: "SOA",
|
87 | callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void,
|
88 | ): void;
|
89 | export function resolve(
|
90 | hostname: string,
|
91 | rrtype: "SRV",
|
92 | callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
|
93 | ): void;
|
94 | export function resolve(
|
95 | hostname: string,
|
96 | rrtype: "TXT",
|
97 | callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
|
98 | ): void;
|
99 | export function resolve(
|
100 | hostname: string,
|
101 | rrtype: string,
|
102 | callback: (
|
103 | err: NodeJS.ErrnoException | null,
|
104 | addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[],
|
105 | ) => void,
|
106 | ): void;
|
107 |
|
108 | export function resolve(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
|
109 | export function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
110 | export function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
111 | export function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
112 | export function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
113 | export function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
114 | export function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
115 | export function resolve(
|
116 | hostname: string,
|
117 | rrtype: string,
|
118 | ): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
119 |
|
120 |
|
121 | export function resolve4(
|
122 | hostname: string,
|
123 | callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
124 | ): void;
|
125 | export function resolve4(
|
126 | hostname: string,
|
127 | options: ResolveWithTtlOptions,
|
128 | callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void,
|
129 | ): void;
|
130 | export function resolve4(
|
131 | hostname: string,
|
132 | options: ResolveOptions,
|
133 | callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void,
|
134 | ): void;
|
135 |
|
136 | export function resolve4(hostname: string): Promise<string[]>;
|
137 | export function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
138 | export function resolve4(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
139 |
|
140 |
|
141 | export function resolve6(
|
142 | hostname: string,
|
143 | callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
144 | ): void;
|
145 | export function resolve6(
|
146 | hostname: string,
|
147 | options: ResolveWithTtlOptions,
|
148 | callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void,
|
149 | ): void;
|
150 | export function resolve6(
|
151 | hostname: string,
|
152 | options: ResolveOptions,
|
153 | callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void,
|
154 | ): void;
|
155 |
|
156 | export function resolve6(hostname: string): Promise<string[]>;
|
157 | export function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
158 | export function resolve6(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
159 |
|
160 | export function resolveCname(
|
161 | hostname: string,
|
162 | callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
163 | ): void;
|
164 | export function resolveCname(hostname: string): Promise<string[]>;
|
165 |
|
166 | export function resolveMx(
|
167 | hostname: string,
|
168 | callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
|
169 | ): void;
|
170 | export function resolveMx(hostname: string): Promise<MxRecord[]>;
|
171 |
|
172 | export function resolveNaptr(
|
173 | hostname: string,
|
174 | callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
|
175 | ): void;
|
176 | export function resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
|
177 |
|
178 | export function resolveNs(
|
179 | hostname: string,
|
180 | callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
181 | ): void;
|
182 | export function resolveNs(hostname: string): Promise<string[]>;
|
183 |
|
184 | export function resolvePtr(
|
185 | hostname: string,
|
186 | callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
187 | ): void;
|
188 | export function resolvePtr(hostname: string): Promise<string[]>;
|
189 |
|
190 | export function resolveSoa(
|
191 | hostname: string,
|
192 | callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void,
|
193 | ): void;
|
194 | export function resolveSoa(hostname: string): Promise<SoaRecord>;
|
195 |
|
196 | export function resolveSrv(
|
197 | hostname: string,
|
198 | callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
|
199 | ): void;
|
200 | export function resolveSrv(hostname: string): Promise<SrvRecord[]>;
|
201 |
|
202 | export function resolveTxt(
|
203 | hostname: string,
|
204 | callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
|
205 | ): void;
|
206 | export function resolveTxt(hostname: string): Promise<string[][]>;
|
207 |
|
208 | export function resolveAny(
|
209 | hostname: string,
|
210 | callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
|
211 | ): void;
|
212 | export function resolveAny(hostname: string): Promise<AnyRecord[]>;
|
213 |
|
214 | export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, domains: string[]) => void): void;
|
215 | export function reverse(ip: string): Promise<string[]>;
|