aboutsummaryrefslogtreecommitdiff
path: root/src/js/node/dns.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/node/dns.js')
-rw-r--r--src/js/node/dns.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/js/node/dns.js b/src/js/node/dns.js
index 2dc3895a2..e82e6a4b5 100644
--- a/src/js/node/dns.js
+++ b/src/js/node/dns.js
@@ -19,6 +19,16 @@ function lookup(domain, options, callback) {
options = { family: options };
}
+ if (domain !== domain || (typeof domain !== "number" && !domain)) {
+ console.warn(
+ `DeprecationWarning: The provided hostname "${String(
+ domain,
+ )}" is not a valid hostname, and is supported in the dns module solely for compatibility.`,
+ );
+ callback(null, null, 4);
+ return;
+ }
+
dns.lookup(domain, options).then(
res => {
res.sort((a, b) => a.family - b.family);