Problem Statement
How does the DNS lookup function work in Node.js?
Explanation
The `dns.lookup()` method converts domain names into IP addresses. It’s part of Node’s built-in `dns` module and is used internally by HTTP requests to resolve hostnames before making connections.
Code Solution
SolutionRead Only
const dns=require('dns');
dns.lookup('google.com',(err,address)=>console.log(address));