imran-dl 2.3.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of imran-dl might be problematic. Click here for more details.

Files changed (229) hide show
  1. package/.cache/nix/binary-cache-v6.sqlite +0 -0
  2. package/.cache/nix/binary-cache-v6.sqlite-journal +0 -0
  3. package/.cache/replit/__replit_disk_meta.json +1 -0
  4. package/.cache/replit/modules/nodejs-20:v32-20240401-269b323.res +1 -0
  5. package/.cache/replit/modules/replit:v8-20240329-787bc7d.res +1 -0
  6. package/.cache/replit/modules.stamp +0 -0
  7. package/.cache/replit/nix/env.json +1 -0
  8. package/.cache/typescript/5.0/node_modules/.package-lock.json +12 -0
  9. package/.cache/typescript/5.0/node_modules/types-registry/README.md +2 -0
  10. package/.cache/typescript/5.0/node_modules/types-registry/index.json +1 -0
  11. package/.cache/typescript/5.0/node_modules/types-registry/package.json +20 -0
  12. package/.cache/typescript/5.0/package.json +1 -0
  13. package/.cache/typescript/5.3/node_modules/.package-lock.json +114 -0
  14. package/.cache/typescript/5.3/node_modules/@types/cheerio/LICENSE +21 -0
  15. package/.cache/typescript/5.3/node_modules/@types/cheerio/README.md +15 -0
  16. package/.cache/typescript/5.3/node_modules/@types/cheerio/index.d.ts +318 -0
  17. package/.cache/typescript/5.3/node_modules/@types/cheerio/package.json +71 -0
  18. package/.cache/typescript/5.3/node_modules/@types/node/LICENSE +21 -0
  19. package/.cache/typescript/5.3/node_modules/@types/node/README.md +15 -0
  20. package/.cache/typescript/5.3/node_modules/@types/node/assert/strict.d.ts +8 -0
  21. package/.cache/typescript/5.3/node_modules/@types/node/assert.d.ts +996 -0
  22. package/.cache/typescript/5.3/node_modules/@types/node/async_hooks.d.ts +539 -0
  23. package/.cache/typescript/5.3/node_modules/@types/node/buffer.d.ts +2362 -0
  24. package/.cache/typescript/5.3/node_modules/@types/node/child_process.d.ts +1540 -0
  25. package/.cache/typescript/5.3/node_modules/@types/node/cluster.d.ts +432 -0
  26. package/.cache/typescript/5.3/node_modules/@types/node/console.d.ts +415 -0
  27. package/.cache/typescript/5.3/node_modules/@types/node/constants.d.ts +19 -0
  28. package/.cache/typescript/5.3/node_modules/@types/node/crypto.d.ts +4456 -0
  29. package/.cache/typescript/5.3/node_modules/@types/node/dgram.d.ts +586 -0
  30. package/.cache/typescript/5.3/node_modules/@types/node/diagnostics_channel.d.ts +191 -0
  31. package/.cache/typescript/5.3/node_modules/@types/node/dns/promises.d.ts +425 -0
  32. package/.cache/typescript/5.3/node_modules/@types/node/dns.d.ts +809 -0
  33. package/.cache/typescript/5.3/node_modules/@types/node/dom-events.d.ts +122 -0
  34. package/.cache/typescript/5.3/node_modules/@types/node/domain.d.ts +170 -0
  35. package/.cache/typescript/5.3/node_modules/@types/node/events.d.ts +879 -0
  36. package/.cache/typescript/5.3/node_modules/@types/node/fs/promises.d.ts +1239 -0
  37. package/.cache/typescript/5.3/node_modules/@types/node/fs.d.ts +4291 -0
  38. package/.cache/typescript/5.3/node_modules/@types/node/globals.d.ts +385 -0
  39. package/.cache/typescript/5.3/node_modules/@types/node/globals.global.d.ts +1 -0
  40. package/.cache/typescript/5.3/node_modules/@types/node/http.d.ts +1888 -0
  41. package/.cache/typescript/5.3/node_modules/@types/node/http2.d.ts +2382 -0
  42. package/.cache/typescript/5.3/node_modules/@types/node/https.d.ts +550 -0
  43. package/.cache/typescript/5.3/node_modules/@types/node/index.d.ts +88 -0
  44. package/.cache/typescript/5.3/node_modules/@types/node/inspector.d.ts +2747 -0
  45. package/.cache/typescript/5.3/node_modules/@types/node/module.d.ts +301 -0
  46. package/.cache/typescript/5.3/node_modules/@types/node/net.d.ts +949 -0
  47. package/.cache/typescript/5.3/node_modules/@types/node/os.d.ts +478 -0
  48. package/.cache/typescript/5.3/node_modules/@types/node/package.json +230 -0
  49. package/.cache/typescript/5.3/node_modules/@types/node/path.d.ts +191 -0
  50. package/.cache/typescript/5.3/node_modules/@types/node/perf_hooks.d.ts +639 -0
  51. package/.cache/typescript/5.3/node_modules/@types/node/process.d.ts +1539 -0
  52. package/.cache/typescript/5.3/node_modules/@types/node/punycode.d.ts +117 -0
  53. package/.cache/typescript/5.3/node_modules/@types/node/querystring.d.ts +141 -0
  54. package/.cache/typescript/5.3/node_modules/@types/node/readline/promises.d.ts +150 -0
  55. package/.cache/typescript/5.3/node_modules/@types/node/readline.d.ts +539 -0
  56. package/.cache/typescript/5.3/node_modules/@types/node/repl.d.ts +430 -0
  57. package/.cache/typescript/5.3/node_modules/@types/node/stream/consumers.d.ts +12 -0
  58. package/.cache/typescript/5.3/node_modules/@types/node/stream/promises.d.ts +83 -0
  59. package/.cache/typescript/5.3/node_modules/@types/node/stream/web.d.ts +350 -0
  60. package/.cache/typescript/5.3/node_modules/@types/node/stream.d.ts +1701 -0
  61. package/.cache/typescript/5.3/node_modules/@types/node/string_decoder.d.ts +67 -0
  62. package/.cache/typescript/5.3/node_modules/@types/node/test.d.ts +1382 -0
  63. package/.cache/typescript/5.3/node_modules/@types/node/timers/promises.d.ts +93 -0
  64. package/.cache/typescript/5.3/node_modules/@types/node/timers.d.ts +240 -0
  65. package/.cache/typescript/5.3/node_modules/@types/node/tls.d.ts +1210 -0
  66. package/.cache/typescript/5.3/node_modules/@types/node/trace_events.d.ts +182 -0
  67. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  68. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/assert.d.ts +996 -0
  69. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/async_hooks.d.ts +539 -0
  70. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/buffer.d.ts +2362 -0
  71. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/child_process.d.ts +1540 -0
  72. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/cluster.d.ts +432 -0
  73. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/console.d.ts +415 -0
  74. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/constants.d.ts +19 -0
  75. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/crypto.d.ts +4455 -0
  76. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/dgram.d.ts +586 -0
  77. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
  78. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/dns/promises.d.ts +425 -0
  79. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/dns.d.ts +809 -0
  80. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/dom-events.d.ts +122 -0
  81. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  82. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/events.d.ts +879 -0
  83. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/fs/promises.d.ts +1239 -0
  84. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/fs.d.ts +4291 -0
  85. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/globals.d.ts +385 -0
  86. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  87. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/http.d.ts +1888 -0
  88. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/http2.d.ts +2382 -0
  89. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/https.d.ts +550 -0
  90. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/index.d.ts +88 -0
  91. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/inspector.d.ts +2747 -0
  92. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/module.d.ts +301 -0
  93. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/net.d.ts +949 -0
  94. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/os.d.ts +478 -0
  95. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  96. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/perf_hooks.d.ts +639 -0
  97. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/process.d.ts +1539 -0
  98. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  99. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/querystring.d.ts +141 -0
  100. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/readline/promises.d.ts +150 -0
  101. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/readline.d.ts +539 -0
  102. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/repl.d.ts +430 -0
  103. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  104. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/stream/promises.d.ts +83 -0
  105. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/stream/web.d.ts +350 -0
  106. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/stream.d.ts +1701 -0
  107. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  108. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/test.d.ts +1382 -0
  109. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
  110. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/timers.d.ts +240 -0
  111. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/tls.d.ts +1210 -0
  112. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
  113. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/tty.d.ts +208 -0
  114. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/url.d.ts +927 -0
  115. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/util.d.ts +2183 -0
  116. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
  117. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/vm.d.ts +903 -0
  118. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/wasi.d.ts +158 -0
  119. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/worker_threads.d.ts +691 -0
  120. package/.cache/typescript/5.3/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  121. package/.cache/typescript/5.3/node_modules/@types/node/tty.d.ts +208 -0
  122. package/.cache/typescript/5.3/node_modules/@types/node/url.d.ts +927 -0
  123. package/.cache/typescript/5.3/node_modules/@types/node/util.d.ts +2183 -0
  124. package/.cache/typescript/5.3/node_modules/@types/node/v8.d.ts +635 -0
  125. package/.cache/typescript/5.3/node_modules/@types/node/vm.d.ts +903 -0
  126. package/.cache/typescript/5.3/node_modules/@types/node/wasi.d.ts +158 -0
  127. package/.cache/typescript/5.3/node_modules/@types/node/worker_threads.d.ts +691 -0
  128. package/.cache/typescript/5.3/node_modules/@types/node/zlib.d.ts +517 -0
  129. package/.cache/typescript/5.3/node_modules/@types/node-fetch/LICENSE +21 -0
  130. package/.cache/typescript/5.3/node_modules/@types/node-fetch/README.md +15 -0
  131. package/.cache/typescript/5.3/node_modules/@types/node-fetch/externals.d.ts +32 -0
  132. package/.cache/typescript/5.3/node_modules/@types/node-fetch/index.d.ts +214 -0
  133. package/.cache/typescript/5.3/node_modules/@types/node-fetch/package.json +83 -0
  134. package/.cache/typescript/5.3/node_modules/@types/qs/LICENSE +21 -0
  135. package/.cache/typescript/5.3/node_modules/@types/qs/README.md +15 -0
  136. package/.cache/typescript/5.3/node_modules/@types/qs/index.d.ts +79 -0
  137. package/.cache/typescript/5.3/node_modules/@types/qs/package.json +65 -0
  138. package/.cache/typescript/5.3/node_modules/asynckit/LICENSE +21 -0
  139. package/.cache/typescript/5.3/node_modules/asynckit/README.md +233 -0
  140. package/.cache/typescript/5.3/node_modules/asynckit/bench.js +76 -0
  141. package/.cache/typescript/5.3/node_modules/asynckit/index.js +6 -0
  142. package/.cache/typescript/5.3/node_modules/asynckit/lib/abort.js +29 -0
  143. package/.cache/typescript/5.3/node_modules/asynckit/lib/async.js +34 -0
  144. package/.cache/typescript/5.3/node_modules/asynckit/lib/defer.js +26 -0
  145. package/.cache/typescript/5.3/node_modules/asynckit/lib/iterate.js +75 -0
  146. package/.cache/typescript/5.3/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  147. package/.cache/typescript/5.3/node_modules/asynckit/lib/readable_parallel.js +25 -0
  148. package/.cache/typescript/5.3/node_modules/asynckit/lib/readable_serial.js +25 -0
  149. package/.cache/typescript/5.3/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  150. package/.cache/typescript/5.3/node_modules/asynckit/lib/state.js +37 -0
  151. package/.cache/typescript/5.3/node_modules/asynckit/lib/streamify.js +141 -0
  152. package/.cache/typescript/5.3/node_modules/asynckit/lib/terminator.js +29 -0
  153. package/.cache/typescript/5.3/node_modules/asynckit/package.json +63 -0
  154. package/.cache/typescript/5.3/node_modules/asynckit/parallel.js +43 -0
  155. package/.cache/typescript/5.3/node_modules/asynckit/serial.js +17 -0
  156. package/.cache/typescript/5.3/node_modules/asynckit/serialOrdered.js +75 -0
  157. package/.cache/typescript/5.3/node_modules/asynckit/stream.js +21 -0
  158. package/.cache/typescript/5.3/node_modules/combined-stream/License +19 -0
  159. package/.cache/typescript/5.3/node_modules/combined-stream/Readme.md +138 -0
  160. package/.cache/typescript/5.3/node_modules/combined-stream/lib/combined_stream.js +208 -0
  161. package/.cache/typescript/5.3/node_modules/combined-stream/package.json +25 -0
  162. package/.cache/typescript/5.3/node_modules/combined-stream/yarn.lock +17 -0
  163. package/.cache/typescript/5.3/node_modules/delayed-stream/License +19 -0
  164. package/.cache/typescript/5.3/node_modules/delayed-stream/Makefile +7 -0
  165. package/.cache/typescript/5.3/node_modules/delayed-stream/Readme.md +141 -0
  166. package/.cache/typescript/5.3/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  167. package/.cache/typescript/5.3/node_modules/delayed-stream/package.json +27 -0
  168. package/.cache/typescript/5.3/node_modules/form-data/License +19 -0
  169. package/.cache/typescript/5.3/node_modules/form-data/README.md.bak +358 -0
  170. package/.cache/typescript/5.3/node_modules/form-data/Readme.md +358 -0
  171. package/.cache/typescript/5.3/node_modules/form-data/index.d.ts +62 -0
  172. package/.cache/typescript/5.3/node_modules/form-data/lib/browser.js +2 -0
  173. package/.cache/typescript/5.3/node_modules/form-data/lib/form_data.js +501 -0
  174. package/.cache/typescript/5.3/node_modules/form-data/lib/populate.js +10 -0
  175. package/.cache/typescript/5.3/node_modules/form-data/package.json +68 -0
  176. package/.cache/typescript/5.3/node_modules/mime-db/HISTORY.md +507 -0
  177. package/.cache/typescript/5.3/node_modules/mime-db/LICENSE +23 -0
  178. package/.cache/typescript/5.3/node_modules/mime-db/README.md +100 -0
  179. package/.cache/typescript/5.3/node_modules/mime-db/db.json +8519 -0
  180. package/.cache/typescript/5.3/node_modules/mime-db/index.js +12 -0
  181. package/.cache/typescript/5.3/node_modules/mime-db/package.json +60 -0
  182. package/.cache/typescript/5.3/node_modules/mime-types/HISTORY.md +397 -0
  183. package/.cache/typescript/5.3/node_modules/mime-types/LICENSE +23 -0
  184. package/.cache/typescript/5.3/node_modules/mime-types/README.md +113 -0
  185. package/.cache/typescript/5.3/node_modules/mime-types/index.js +188 -0
  186. package/.cache/typescript/5.3/node_modules/mime-types/package.json +44 -0
  187. package/.cache/typescript/5.3/node_modules/types-registry/README.md +2 -0
  188. package/.cache/typescript/5.3/node_modules/types-registry/index.json +1 -0
  189. package/.cache/typescript/5.3/node_modules/types-registry/package.json +20 -0
  190. package/.cache/typescript/5.3/node_modules/undici-types/README.md +6 -0
  191. package/.cache/typescript/5.3/node_modules/undici-types/agent.d.ts +31 -0
  192. package/.cache/typescript/5.3/node_modules/undici-types/api.d.ts +43 -0
  193. package/.cache/typescript/5.3/node_modules/undici-types/balanced-pool.d.ts +18 -0
  194. package/.cache/typescript/5.3/node_modules/undici-types/cache.d.ts +36 -0
  195. package/.cache/typescript/5.3/node_modules/undici-types/client.d.ts +97 -0
  196. package/.cache/typescript/5.3/node_modules/undici-types/connector.d.ts +34 -0
  197. package/.cache/typescript/5.3/node_modules/undici-types/content-type.d.ts +21 -0
  198. package/.cache/typescript/5.3/node_modules/undici-types/cookies.d.ts +28 -0
  199. package/.cache/typescript/5.3/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
  200. package/.cache/typescript/5.3/node_modules/undici-types/dispatcher.d.ts +241 -0
  201. package/.cache/typescript/5.3/node_modules/undici-types/errors.d.ts +128 -0
  202. package/.cache/typescript/5.3/node_modules/undici-types/fetch.d.ts +209 -0
  203. package/.cache/typescript/5.3/node_modules/undici-types/file.d.ts +39 -0
  204. package/.cache/typescript/5.3/node_modules/undici-types/filereader.d.ts +54 -0
  205. package/.cache/typescript/5.3/node_modules/undici-types/formdata.d.ts +108 -0
  206. package/.cache/typescript/5.3/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  207. package/.cache/typescript/5.3/node_modules/undici-types/global-origin.d.ts +7 -0
  208. package/.cache/typescript/5.3/node_modules/undici-types/handlers.d.ts +9 -0
  209. package/.cache/typescript/5.3/node_modules/undici-types/header.d.ts +4 -0
  210. package/.cache/typescript/5.3/node_modules/undici-types/index.d.ts +63 -0
  211. package/.cache/typescript/5.3/node_modules/undici-types/interceptors.d.ts +5 -0
  212. package/.cache/typescript/5.3/node_modules/undici-types/mock-agent.d.ts +50 -0
  213. package/.cache/typescript/5.3/node_modules/undici-types/mock-client.d.ts +25 -0
  214. package/.cache/typescript/5.3/node_modules/undici-types/mock-errors.d.ts +12 -0
  215. package/.cache/typescript/5.3/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  216. package/.cache/typescript/5.3/node_modules/undici-types/mock-pool.d.ts +25 -0
  217. package/.cache/typescript/5.3/node_modules/undici-types/package.json +55 -0
  218. package/.cache/typescript/5.3/node_modules/undici-types/patch.d.ts +71 -0
  219. package/.cache/typescript/5.3/node_modules/undici-types/pool-stats.d.ts +19 -0
  220. package/.cache/typescript/5.3/node_modules/undici-types/pool.d.ts +28 -0
  221. package/.cache/typescript/5.3/node_modules/undici-types/proxy-agent.d.ts +30 -0
  222. package/.cache/typescript/5.3/node_modules/undici-types/readable.d.ts +61 -0
  223. package/.cache/typescript/5.3/node_modules/undici-types/webidl.d.ts +220 -0
  224. package/.cache/typescript/5.3/node_modules/undici-types/websocket.d.ts +131 -0
  225. package/.cache/typescript/5.3/package.json +1 -0
  226. package/IMRAN/module.js +1 -0
  227. package/README.md +64 -0
  228. package/index.js +13 -0
  229. package/package.json +48 -0
@@ -0,0 +1,809 @@
1
+ /**
2
+ * The `node:dns` module enables name resolution. For example, use it to look up IP
3
+ * addresses of host names.
4
+ *
5
+ * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the
6
+ * DNS protocol for lookups. {@link lookup} uses the operating system
7
+ * facilities to perform name resolution. It may not need to perform any network
8
+ * communication. To perform name resolution the way other applications on the same
9
+ * system do, use {@link lookup}.
10
+ *
11
+ * ```js
12
+ * const dns = require('node:dns');
13
+ *
14
+ * dns.lookup('example.org', (err, address, family) => {
15
+ * console.log('address: %j family: IPv%s', address, family);
16
+ * });
17
+ * // address: "93.184.216.34" family: IPv4
18
+ * ```
19
+ *
20
+ * All other functions in the `node:dns` module connect to an actual DNS server to
21
+ * perform name resolution. They will always use the network to perform DNS
22
+ * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform
23
+ * DNS queries, bypassing other name-resolution facilities.
24
+ *
25
+ * ```js
26
+ * const dns = require('node:dns');
27
+ *
28
+ * dns.resolve4('archive.org', (err, addresses) => {
29
+ * if (err) throw err;
30
+ *
31
+ * console.log(`addresses: ${JSON.stringify(addresses)}`);
32
+ *
33
+ * addresses.forEach((a) => {
34
+ * dns.reverse(a, (err, hostnames) => {
35
+ * if (err) {
36
+ * throw err;
37
+ * }
38
+ * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`);
39
+ * });
40
+ * });
41
+ * });
42
+ * ```
43
+ *
44
+ * See the `Implementation considerations section` for more information.
45
+ * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dns.js)
46
+ */
47
+ declare module "dns" {
48
+ import * as dnsPromises from "node:dns/promises";
49
+ // Supported getaddrinfo flags.
50
+ export const ADDRCONFIG: number;
51
+ export const V4MAPPED: number;
52
+ /**
53
+ * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as
54
+ * well as IPv4 mapped IPv6 addresses.
55
+ */
56
+ export const ALL: number;
57
+ export interface LookupOptions {
58
+ family?: number | undefined;
59
+ hints?: number | undefined;
60
+ all?: boolean | undefined;
61
+ /**
62
+ * @default true
63
+ */
64
+ verbatim?: boolean | undefined;
65
+ }
66
+ export interface LookupOneOptions extends LookupOptions {
67
+ all?: false | undefined;
68
+ }
69
+ export interface LookupAllOptions extends LookupOptions {
70
+ all: true;
71
+ }
72
+ export interface LookupAddress {
73
+ address: string;
74
+ family: number;
75
+ }
76
+ /**
77
+ * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or
78
+ * AAAA (IPv6) record. All `option` properties are optional. If `options` is an
79
+ * integer, then it must be `4` or `6` – if `options` is `0` or not provided, then
80
+ * IPv4 and IPv6 addresses are both returned if found.
81
+ *
82
+ * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the
83
+ * properties `address` and `family`.
84
+ *
85
+ * On error, `err` is an `Error` object, where `err.code` is the error code.
86
+ * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
87
+ * the host name does not exist but also when the lookup fails in other ways
88
+ * such as no available file descriptors.
89
+ *
90
+ * `dns.lookup()` does not necessarily have anything to do with the DNS protocol.
91
+ * The implementation uses an operating system facility that can associate names
92
+ * with addresses and vice versa. This implementation can have subtle but
93
+ * important consequences on the behavior of any Node.js program. Please take some
94
+ * time to consult the `Implementation considerations section` before using`dns.lookup()`.
95
+ *
96
+ * Example usage:
97
+ *
98
+ * ```js
99
+ * const dns = require('node:dns');
100
+ * const options = {
101
+ * family: 6,
102
+ * hints: dns.ADDRCONFIG | dns.V4MAPPED,
103
+ * };
104
+ * dns.lookup('example.com', options, (err, address, family) =>
105
+ * console.log('address: %j family: IPv%s', address, family));
106
+ * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6
107
+ *
108
+ * // When options.all is true, the result will be an Array.
109
+ * options.all = true;
110
+ * dns.lookup('example.com', options, (err, addresses) =>
111
+ * console.log('addresses: %j', addresses));
112
+ * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}]
113
+ * ```
114
+ *
115
+ * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties.
116
+ * @since v0.1.90
117
+ */
118
+ export function lookup(
119
+ hostname: string,
120
+ family: number,
121
+ callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
122
+ ): void;
123
+ export function lookup(
124
+ hostname: string,
125
+ options: LookupOneOptions,
126
+ callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
127
+ ): void;
128
+ export function lookup(
129
+ hostname: string,
130
+ options: LookupAllOptions,
131
+ callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void,
132
+ ): void;
133
+ export function lookup(
134
+ hostname: string,
135
+ options: LookupOptions,
136
+ callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void,
137
+ ): void;
138
+ export function lookup(
139
+ hostname: string,
140
+ callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
141
+ ): void;
142
+ export namespace lookup {
143
+ function __promisify__(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
144
+ function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<LookupAddress>;
145
+ function __promisify__(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
146
+ }
147
+ /**
148
+ * Resolves the given `address` and `port` into a host name and service using
149
+ * the operating system's underlying `getnameinfo` implementation.
150
+ *
151
+ * If `address` is not a valid IP address, a `TypeError` will be thrown.
152
+ * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown.
153
+ *
154
+ * On an error, `err` is an `Error` object, where `err.code` is the error code.
155
+ *
156
+ * ```js
157
+ * const dns = require('node:dns');
158
+ * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
159
+ * console.log(hostname, service);
160
+ * // Prints: localhost ssh
161
+ * });
162
+ * ```
163
+ *
164
+ * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties.
165
+ * @since v0.11.14
166
+ */
167
+ export function lookupService(
168
+ address: string,
169
+ port: number,
170
+ callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void,
171
+ ): void;
172
+ export namespace lookupService {
173
+ function __promisify__(
174
+ address: string,
175
+ port: number,
176
+ ): Promise<{
177
+ hostname: string;
178
+ service: string;
179
+ }>;
180
+ }
181
+ export interface ResolveOptions {
182
+ ttl: boolean;
183
+ }
184
+ export interface ResolveWithTtlOptions extends ResolveOptions {
185
+ ttl: true;
186
+ }
187
+ export interface RecordWithTtl {
188
+ address: string;
189
+ ttl: number;
190
+ }
191
+ /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */
192
+ export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord;
193
+ export interface AnyARecord extends RecordWithTtl {
194
+ type: "A";
195
+ }
196
+ export interface AnyAaaaRecord extends RecordWithTtl {
197
+ type: "AAAA";
198
+ }
199
+ export interface CaaRecord {
200
+ critical: number;
201
+ issue?: string | undefined;
202
+ issuewild?: string | undefined;
203
+ iodef?: string | undefined;
204
+ contactemail?: string | undefined;
205
+ contactphone?: string | undefined;
206
+ }
207
+ export interface MxRecord {
208
+ priority: number;
209
+ exchange: string;
210
+ }
211
+ export interface AnyMxRecord extends MxRecord {
212
+ type: "MX";
213
+ }
214
+ export interface NaptrRecord {
215
+ flags: string;
216
+ service: string;
217
+ regexp: string;
218
+ replacement: string;
219
+ order: number;
220
+ preference: number;
221
+ }
222
+ export interface AnyNaptrRecord extends NaptrRecord {
223
+ type: "NAPTR";
224
+ }
225
+ export interface SoaRecord {
226
+ nsname: string;
227
+ hostmaster: string;
228
+ serial: number;
229
+ refresh: number;
230
+ retry: number;
231
+ expire: number;
232
+ minttl: number;
233
+ }
234
+ export interface AnySoaRecord extends SoaRecord {
235
+ type: "SOA";
236
+ }
237
+ export interface SrvRecord {
238
+ priority: number;
239
+ weight: number;
240
+ port: number;
241
+ name: string;
242
+ }
243
+ export interface AnySrvRecord extends SrvRecord {
244
+ type: "SRV";
245
+ }
246
+ export interface AnyTxtRecord {
247
+ type: "TXT";
248
+ entries: string[];
249
+ }
250
+ export interface AnyNsRecord {
251
+ type: "NS";
252
+ value: string;
253
+ }
254
+ export interface AnyPtrRecord {
255
+ type: "PTR";
256
+ value: string;
257
+ }
258
+ export interface AnyCnameRecord {
259
+ type: "CNAME";
260
+ value: string;
261
+ }
262
+ export type AnyRecord =
263
+ | AnyARecord
264
+ | AnyAaaaRecord
265
+ | AnyCnameRecord
266
+ | AnyMxRecord
267
+ | AnyNaptrRecord
268
+ | AnyNsRecord
269
+ | AnyPtrRecord
270
+ | AnySoaRecord
271
+ | AnySrvRecord
272
+ | AnyTxtRecord;
273
+ /**
274
+ * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
275
+ * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource
276
+ * records. The type and structure of individual results varies based on `rrtype`:
277
+ *
278
+ * <omitted>
279
+ *
280
+ * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`.
281
+ * @since v0.1.27
282
+ * @param hostname Host name to resolve.
283
+ * @param [rrtype='A'] Resource record type.
284
+ */
285
+ export function resolve(
286
+ hostname: string,
287
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
288
+ ): void;
289
+ export function resolve(
290
+ hostname: string,
291
+ rrtype: "A",
292
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
293
+ ): void;
294
+ export function resolve(
295
+ hostname: string,
296
+ rrtype: "AAAA",
297
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
298
+ ): void;
299
+ export function resolve(
300
+ hostname: string,
301
+ rrtype: "ANY",
302
+ callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
303
+ ): void;
304
+ export function resolve(
305
+ hostname: string,
306
+ rrtype: "CNAME",
307
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
308
+ ): void;
309
+ export function resolve(
310
+ hostname: string,
311
+ rrtype: "MX",
312
+ callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
313
+ ): void;
314
+ export function resolve(
315
+ hostname: string,
316
+ rrtype: "NAPTR",
317
+ callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
318
+ ): void;
319
+ export function resolve(
320
+ hostname: string,
321
+ rrtype: "NS",
322
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
323
+ ): void;
324
+ export function resolve(
325
+ hostname: string,
326
+ rrtype: "PTR",
327
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
328
+ ): void;
329
+ export function resolve(
330
+ hostname: string,
331
+ rrtype: "SOA",
332
+ callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void,
333
+ ): void;
334
+ export function resolve(
335
+ hostname: string,
336
+ rrtype: "SRV",
337
+ callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
338
+ ): void;
339
+ export function resolve(
340
+ hostname: string,
341
+ rrtype: "TXT",
342
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
343
+ ): void;
344
+ export function resolve(
345
+ hostname: string,
346
+ rrtype: string,
347
+ callback: (
348
+ err: NodeJS.ErrnoException | null,
349
+ addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[],
350
+ ) => void,
351
+ ): void;
352
+ export namespace resolve {
353
+ function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
354
+ function __promisify__(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
355
+ function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
356
+ function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
357
+ function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
358
+ function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
359
+ function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
360
+ function __promisify__(
361
+ hostname: string,
362
+ rrtype: string,
363
+ ): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
364
+ }
365
+ /**
366
+ * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function
367
+ * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
368
+ * @since v0.1.16
369
+ * @param hostname Host name to resolve.
370
+ */
371
+ export function resolve4(
372
+ hostname: string,
373
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
374
+ ): void;
375
+ export function resolve4(
376
+ hostname: string,
377
+ options: ResolveWithTtlOptions,
378
+ callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void,
379
+ ): void;
380
+ export function resolve4(
381
+ hostname: string,
382
+ options: ResolveOptions,
383
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void,
384
+ ): void;
385
+ export namespace resolve4 {
386
+ function __promisify__(hostname: string): Promise<string[]>;
387
+ function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
388
+ function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
389
+ }
390
+ /**
391
+ * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function
392
+ * will contain an array of IPv6 addresses.
393
+ * @since v0.1.16
394
+ * @param hostname Host name to resolve.
395
+ */
396
+ export function resolve6(
397
+ hostname: string,
398
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
399
+ ): void;
400
+ export function resolve6(
401
+ hostname: string,
402
+ options: ResolveWithTtlOptions,
403
+ callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void,
404
+ ): void;
405
+ export function resolve6(
406
+ hostname: string,
407
+ options: ResolveOptions,
408
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void,
409
+ ): void;
410
+ export namespace resolve6 {
411
+ function __promisify__(hostname: string): Promise<string[]>;
412
+ function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
413
+ function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
414
+ }
415
+ /**
416
+ * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function
417
+ * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`).
418
+ * @since v0.3.2
419
+ */
420
+ export function resolveCname(
421
+ hostname: string,
422
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
423
+ ): void;
424
+ export namespace resolveCname {
425
+ function __promisify__(hostname: string): Promise<string[]>;
426
+ }
427
+ /**
428
+ * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function
429
+ * will contain an array of certification authority authorization records
430
+ * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`).
431
+ * @since v15.0.0, v14.17.0
432
+ */
433
+ export function resolveCaa(
434
+ hostname: string,
435
+ callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void,
436
+ ): void;
437
+ export namespace resolveCaa {
438
+ function __promisify__(hostname: string): Promise<CaaRecord[]>;
439
+ }
440
+ /**
441
+ * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
442
+ * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
443
+ * @since v0.1.27
444
+ */
445
+ export function resolveMx(
446
+ hostname: string,
447
+ callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
448
+ ): void;
449
+ export namespace resolveMx {
450
+ function __promisify__(hostname: string): Promise<MxRecord[]>;
451
+ }
452
+ /**
453
+ * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of
454
+ * objects with the following properties:
455
+ *
456
+ * * `flags`
457
+ * * `service`
458
+ * * `regexp`
459
+ * * `replacement`
460
+ * * `order`
461
+ * * `preference`
462
+ *
463
+ * ```js
464
+ * {
465
+ * flags: 's',
466
+ * service: 'SIP+D2U',
467
+ * regexp: '',
468
+ * replacement: '_sip._udp.example.com',
469
+ * order: 30,
470
+ * preference: 100
471
+ * }
472
+ * ```
473
+ * @since v0.9.12
474
+ */
475
+ export function resolveNaptr(
476
+ hostname: string,
477
+ callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
478
+ ): void;
479
+ export namespace resolveNaptr {
480
+ function __promisify__(hostname: string): Promise<NaptrRecord[]>;
481
+ }
482
+ /**
483
+ * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
484
+ * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`).
485
+ * @since v0.1.90
486
+ */
487
+ export function resolveNs(
488
+ hostname: string,
489
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
490
+ ): void;
491
+ export namespace resolveNs {
492
+ function __promisify__(hostname: string): Promise<string[]>;
493
+ }
494
+ /**
495
+ * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
496
+ * be an array of strings containing the reply records.
497
+ * @since v6.0.0
498
+ */
499
+ export function resolvePtr(
500
+ hostname: string,
501
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
502
+ ): void;
503
+ export namespace resolvePtr {
504
+ function __promisify__(hostname: string): Promise<string[]>;
505
+ }
506
+ /**
507
+ * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for
508
+ * the `hostname`. The `address` argument passed to the `callback` function will
509
+ * be an object with the following properties:
510
+ *
511
+ * * `nsname`
512
+ * * `hostmaster`
513
+ * * `serial`
514
+ * * `refresh`
515
+ * * `retry`
516
+ * * `expire`
517
+ * * `minttl`
518
+ *
519
+ * ```js
520
+ * {
521
+ * nsname: 'ns.example.com',
522
+ * hostmaster: 'root.example.com',
523
+ * serial: 2013101809,
524
+ * refresh: 10000,
525
+ * retry: 2400,
526
+ * expire: 604800,
527
+ * minttl: 3600
528
+ * }
529
+ * ```
530
+ * @since v0.11.10
531
+ */
532
+ export function resolveSoa(
533
+ hostname: string,
534
+ callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void,
535
+ ): void;
536
+ export namespace resolveSoa {
537
+ function __promisify__(hostname: string): Promise<SoaRecord>;
538
+ }
539
+ /**
540
+ * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
541
+ * be an array of objects with the following properties:
542
+ *
543
+ * * `priority`
544
+ * * `weight`
545
+ * * `port`
546
+ * * `name`
547
+ *
548
+ * ```js
549
+ * {
550
+ * priority: 10,
551
+ * weight: 5,
552
+ * port: 21223,
553
+ * name: 'service.example.com'
554
+ * }
555
+ * ```
556
+ * @since v0.1.27
557
+ */
558
+ export function resolveSrv(
559
+ hostname: string,
560
+ callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
561
+ ): void;
562
+ export namespace resolveSrv {
563
+ function __promisify__(hostname: string): Promise<SrvRecord[]>;
564
+ }
565
+ /**
566
+ * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a
567
+ * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
568
+ * one record. Depending on the use case, these could be either joined together or
569
+ * treated separately.
570
+ * @since v0.1.27
571
+ */
572
+ export function resolveTxt(
573
+ hostname: string,
574
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
575
+ ): void;
576
+ export namespace resolveTxt {
577
+ function __promisify__(hostname: string): Promise<string[][]>;
578
+ }
579
+ /**
580
+ * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query).
581
+ * The `ret` argument passed to the `callback` function will be an array containing
582
+ * various types of records. Each object has a property `type` that indicates the
583
+ * type of the current record. And depending on the `type`, additional properties
584
+ * will be present on the object:
585
+ *
586
+ * <omitted>
587
+ *
588
+ * Here is an example of the `ret` object passed to the callback:
589
+ *
590
+ * ```js
591
+ * [ { type: 'A', address: '127.0.0.1', ttl: 299 },
592
+ * { type: 'CNAME', value: 'example.com' },
593
+ * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },
594
+ * { type: 'NS', value: 'ns1.example.com' },
595
+ * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },
596
+ * { type: 'SOA',
597
+ * nsname: 'ns1.example.com',
598
+ * hostmaster: 'admin.example.com',
599
+ * serial: 156696742,
600
+ * refresh: 900,
601
+ * retry: 900,
602
+ * expire: 1800,
603
+ * minttl: 60 } ]
604
+ * ```
605
+ *
606
+ * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC
607
+ * 8482](https://tools.ietf.org/html/rfc8482).
608
+ */
609
+ export function resolveAny(
610
+ hostname: string,
611
+ callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
612
+ ): void;
613
+ export namespace resolveAny {
614
+ function __promisify__(hostname: string): Promise<AnyRecord[]>;
615
+ }
616
+ /**
617
+ * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
618
+ * array of host names.
619
+ *
620
+ * On error, `err` is an `Error` object, where `err.code` is
621
+ * one of the `DNS error codes`.
622
+ * @since v0.1.16
623
+ */
624
+ export function reverse(
625
+ ip: string,
626
+ callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
627
+ ): void;
628
+ /**
629
+ * Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:
630
+ *
631
+ * * `ipv4first`: for `verbatim` defaulting to `false`.
632
+ * * `verbatim`: for `verbatim` defaulting to `true`.
633
+ * @since v20.1.0
634
+ */
635
+ export function getDefaultResultOrder(): "ipv4first" | "verbatim";
636
+ /**
637
+ * Sets the IP address and port of servers to be used when performing DNS
638
+ * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
639
+ * addresses. If the port is the IANA default DNS port (53) it can be omitted.
640
+ *
641
+ * ```js
642
+ * dns.setServers([
643
+ * '4.4.4.4',
644
+ * '[2001:4860:4860::8888]',
645
+ * '4.4.4.4:1053',
646
+ * '[2001:4860:4860::8888]:1053',
647
+ * ]);
648
+ * ```
649
+ *
650
+ * An error will be thrown if an invalid address is provided.
651
+ *
652
+ * The `dns.setServers()` method must not be called while a DNS query is in
653
+ * progress.
654
+ *
655
+ * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}).
656
+ *
657
+ * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
658
+ * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with
659
+ * subsequent servers provided. Fallback DNS servers will only be used if the
660
+ * earlier ones time out or result in some other error.
661
+ * @since v0.11.3
662
+ * @param servers array of `RFC 5952` formatted addresses
663
+ */
664
+ export function setServers(servers: readonly string[]): void;
665
+ /**
666
+ * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),
667
+ * that are currently configured for DNS resolution. A string will include a port
668
+ * section if a custom port is used.
669
+ *
670
+ * ```js
671
+ * [
672
+ * '4.4.4.4',
673
+ * '2001:4860:4860::8888',
674
+ * '4.4.4.4:1053',
675
+ * '[2001:4860:4860::8888]:1053',
676
+ * ]
677
+ * ```
678
+ * @since v0.11.3
679
+ */
680
+ export function getServers(): string[];
681
+ /**
682
+ * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:
683
+ *
684
+ * * `ipv4first`: sets default `verbatim` `false`.
685
+ * * `verbatim`: sets default `verbatim` `true`.
686
+ *
687
+ * The default is `verbatim` and {@link setDefaultResultOrder} have higher
688
+ * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default
689
+ * dns orders in workers.
690
+ * @since v16.4.0, v14.18.0
691
+ * @param order must be `'ipv4first'` or `'verbatim'`.
692
+ */
693
+ export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
694
+ // Error codes
695
+ export const NODATA: string;
696
+ export const FORMERR: string;
697
+ export const SERVFAIL: string;
698
+ export const NOTFOUND: string;
699
+ export const NOTIMP: string;
700
+ export const REFUSED: string;
701
+ export const BADQUERY: string;
702
+ export const BADNAME: string;
703
+ export const BADFAMILY: string;
704
+ export const BADRESP: string;
705
+ export const CONNREFUSED: string;
706
+ export const TIMEOUT: string;
707
+ export const EOF: string;
708
+ export const FILE: string;
709
+ export const NOMEM: string;
710
+ export const DESTRUCTION: string;
711
+ export const BADSTR: string;
712
+ export const BADFLAGS: string;
713
+ export const NONAME: string;
714
+ export const BADHINTS: string;
715
+ export const NOTINITIALIZED: string;
716
+ export const LOADIPHLPAPI: string;
717
+ export const ADDRGETNETWORKPARAMS: string;
718
+ export const CANCELLED: string;
719
+ export interface ResolverOptions {
720
+ timeout?: number | undefined;
721
+ /**
722
+ * @default 4
723
+ */
724
+ tries?: number;
725
+ }
726
+ /**
727
+ * An independent resolver for DNS requests.
728
+ *
729
+ * Creating a new resolver uses the default server settings. Setting
730
+ * the servers used for a resolver using `resolver.setServers()` does not affect
731
+ * other resolvers:
732
+ *
733
+ * ```js
734
+ * const { Resolver } = require('node:dns');
735
+ * const resolver = new Resolver();
736
+ * resolver.setServers(['4.4.4.4']);
737
+ *
738
+ * // This request will use the server at 4.4.4.4, independent of global settings.
739
+ * resolver.resolve4('example.org', (err, addresses) => {
740
+ * // ...
741
+ * });
742
+ * ```
743
+ *
744
+ * The following methods from the `node:dns` module are available:
745
+ *
746
+ * * `resolver.getServers()`
747
+ * * `resolver.resolve()`
748
+ * * `resolver.resolve4()`
749
+ * * `resolver.resolve6()`
750
+ * * `resolver.resolveAny()`
751
+ * * `resolver.resolveCaa()`
752
+ * * `resolver.resolveCname()`
753
+ * * `resolver.resolveMx()`
754
+ * * `resolver.resolveNaptr()`
755
+ * * `resolver.resolveNs()`
756
+ * * `resolver.resolvePtr()`
757
+ * * `resolver.resolveSoa()`
758
+ * * `resolver.resolveSrv()`
759
+ * * `resolver.resolveTxt()`
760
+ * * `resolver.reverse()`
761
+ * * `resolver.setServers()`
762
+ * @since v8.3.0
763
+ */
764
+ export class Resolver {
765
+ constructor(options?: ResolverOptions);
766
+ /**
767
+ * Cancel all outstanding DNS queries made by this resolver. The corresponding
768
+ * callbacks will be called with an error with code `ECANCELLED`.
769
+ * @since v8.3.0
770
+ */
771
+ cancel(): void;
772
+ getServers: typeof getServers;
773
+ resolve: typeof resolve;
774
+ resolve4: typeof resolve4;
775
+ resolve6: typeof resolve6;
776
+ resolveAny: typeof resolveAny;
777
+ resolveCaa: typeof resolveCaa;
778
+ resolveCname: typeof resolveCname;
779
+ resolveMx: typeof resolveMx;
780
+ resolveNaptr: typeof resolveNaptr;
781
+ resolveNs: typeof resolveNs;
782
+ resolvePtr: typeof resolvePtr;
783
+ resolveSoa: typeof resolveSoa;
784
+ resolveSrv: typeof resolveSrv;
785
+ resolveTxt: typeof resolveTxt;
786
+ reverse: typeof reverse;
787
+ /**
788
+ * The resolver instance will send its requests from the specified IP address.
789
+ * This allows programs to specify outbound interfaces when used on multi-homed
790
+ * systems.
791
+ *
792
+ * If a v4 or v6 address is not specified, it is set to the default and the
793
+ * operating system will choose a local address automatically.
794
+ *
795
+ * The resolver will use the v4 local address when making requests to IPv4 DNS
796
+ * servers, and the v6 local address when making requests to IPv6 DNS servers.
797
+ * The `rrtype` of resolution requests has no impact on the local address used.
798
+ * @since v15.1.0, v14.17.0
799
+ * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
800
+ * @param [ipv6='::0'] A string representation of an IPv6 address.
801
+ */
802
+ setLocalAddress(ipv4?: string, ipv6?: string): void;
803
+ setServers: typeof setServers;
804
+ }
805
+ export { dnsPromises as promises };
806
+ }
807
+ declare module "node:dns" {
808
+ export * from "dns";
809
+ }