nl_tokens: Uses the DNS protocol to resolve a IPv4 and IPv6 addresses ( A and AAAA records ) for the hostname
pl_tokens: function resolveAll ( name , callback ) { const addresses = [ ] ; utils . parallel ( [ function resolve4 ( next ) { dns . resolve4 ( <mask> , function resolve4Callback ( err , arr ) { if ( arr ) { arr . forEach ( address => addresses . push ( { address , isIPv6 : false } ) ) ; } // Ignore error next ( ) ; } ) ; } , function resolve6 ( next ) { dns . resolve6 ( name , function resolve6Callback ( err , arr ) { if ( arr ) { arr . forEach ( address => addresses . push ( { address , isIPv6 : true } ) ) ; } // Ignore error next ( ) ; } ) ; } ] , function resolveAllCallback ( ) { if ( addresses . length === 0 ) { // In case dns.resolve*() methods don't yield a valid address for the host name // Use system call getaddrinfo() that might resolve according to host system definitions return dns . lookup ( name , function ( err , address , family ) { if ( err ) { return callback ( err ) ; } addresses . push ( { address , isIPv6 : family === 6 } ) ; callback ( null , addresses ) ; } ) ; } callback ( null , addresses ) ; } ) ; }