DNS in nodeJS
Introduction
- Domain Name System (DNS)
- The DNS module enables name resolution. For example, use it to look up IP addresses of hostnames
- Uses the DNS protocol for lookups
- dns.lookup() uses the operating system facilities to perform name resolution
const dns = require('dns'); dns.lookup('domainname', (err, address, family) => { console.log('address: %j family: IPv%s', address, family); }); // address: IP address family: IPv4