@@ -209,14 +209,14 @@ assert.deepStrictEqual(dns.getServers(), []);
209209{
210210 /*
211211 * Make sure that dns.lookup throws if hints does not represent a valid flag.
212- * (dns.V4MAPPED | dns.ADDRCONFIG) + 1 is invalid because:
213- * - it's different from dns.V4MAPPED and dns.ADDRCONFIG.
214- * - it's different from them bitwise ored.
212+ * (dns.V4MAPPED | dns.ADDRCONFIG | dns.ALL ) + 1 is invalid because:
213+ * - it's different from dns.V4MAPPED and dns.ADDRCONFIG and dns.ALL .
214+ * - it's different from any subset of them bitwise ored.
215215 * - it's different from 0.
216216 * - it's an odd number different than 1, and thus is invalid, because
217217 * flags are either === 1 or even.
218218 */
219- const hints = ( dns . V4MAPPED | dns . ADDRCONFIG ) + 1 ;
219+ const hints = ( dns . V4MAPPED | dns . ADDRCONFIG | dns . ALL ) + 1 ;
220220 const err = {
221221 code : 'ERR_INVALID_OPT_VALUE' ,
222222 name : 'TypeError' ,
@@ -254,11 +254,28 @@ dns.lookup('', {
254254 hints : dns . ADDRCONFIG | dns . V4MAPPED
255255} , common . mustCall ( ) ) ;
256256
257+ dns . lookup ( '' , {
258+ hints : dns . ALL
259+ } , common . mustCall ( ) ) ;
260+
261+ dns . lookup ( '' , {
262+ hints : dns . V4MAPPED | dns . ALL
263+ } , common . mustCall ( ) ) ;
264+
265+ dns . lookup ( '' , {
266+ hints : dns . ADDRCONFIG | dns . V4MAPPED | dns . ALL
267+ } , common . mustCall ( ) ) ;
268+
257269( async function ( ) {
258270 await dnsPromises . lookup ( '' , { family : 4 , hints : 0 } ) ;
259271 await dnsPromises . lookup ( '' , { family : 6 , hints : dns . ADDRCONFIG } ) ;
260272 await dnsPromises . lookup ( '' , { hints : dns . V4MAPPED } ) ;
261273 await dnsPromises . lookup ( '' , { hints : dns . ADDRCONFIG | dns . V4MAPPED } ) ;
274+ await dnsPromises . lookup ( '' , { hints : dns . ALL } ) ;
275+ await dnsPromises . lookup ( '' , { hints : dns . V4MAPPED | dns . ALL } ) ;
276+ await dnsPromises . lookup ( '' , {
277+ hints : dns . ADDRCONFIG | dns . V4MAPPED | dns . ALL
278+ } ) ;
262279} ) ( ) ;
263280
264281{
0 commit comments