From baa8c15abfcc51ba0191e14ee2a665e069ed5998 Mon Sep 17 00:00:00 2001 From: Ouyang Yadong Date: Tue, 6 Apr 2021 00:31:36 +0800 Subject: [PATCH] dns: allow NODE_DNS_VERBATIM to change default verbatim Allow the NODE_DNS_VERBATIM environment variable to change the default value of `verbatim` in `dns.lookup()`. --- doc/api/cli.md | 10 +++++ lib/dns.js | 3 +- lib/internal/dns/promises.js | 4 +- lib/internal/dns/utils.js | 12 ++++++ lib/internal/main/print_help.js | 2 + test/parallel/test-dns-default-verbatim.js | 50 ++++++++++++++++++++++ 6 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 test/parallel/test-dns-default-verbatim.js diff --git a/doc/api/cli.md b/doc/api/cli.md index 055eac22f6f0a2..8c31b800365989 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1295,6 +1295,15 @@ added: v0.3.0 When set, colors will not be used in the REPL. +### `NODE_DNS_VERBATIM=[0, 1]` + + +Set the default value of `verbatim` in [`dns.lookup()`][]. The value may be: +* `0` to indicate `false` +* `1` to indicate `true` + ### `NODE_EXTRA_CA_CERTS=file`