I’m very new to Node.js and I’m having an issue using node.dns.resolveNs function.
Some domains are completely down and it takes about a minute to get the response, which is usually “queryNs ETIMEOUT”. Is there a way for me to set it to a shorter period, for example 10 seconds?
I am not sure of any way to set a timeout directly on the function call, but you could create a small wrapper around the call to handle timing out yourself:
The output for the above script: