Index: nmap_dns.cc =================================================================== --- nmap_dns.cc (revision 10853) +++ nmap_dns.cc (working copy) @@ -1110,8 +1110,14 @@ /* Initialize the global servs list of DNS servers. If the --dns-servers option * was given, use the listed servers; otherwise get the list from resolv.conf or - * the Windows registry. */ + * the Windows registry. If o.mass_dns is false, the list of servers is + * emptied. */ static void init_servs(void) { + if (!o.mass_dns) { + servs.clear(); + return; + } + if (o.dns_servers) { add_dns_server(o.dns_servers); } else { @@ -1307,7 +1313,8 @@ stat_actual = stat_ok = stat_nx = stat_sf = stat_trans = stat_dropped = stat_cname = 0; - if (o.mass_dns) + // mass_dns only supports IPv4. + if (o.mass_dns && o.af() == AF_INET) nmap_mass_rdns_core(targets, num_targets); else nmap_system_rdns_core(targets, num_targets); @@ -1340,10 +1347,8 @@ // Returns a list of known DNS servers std::list get_dns_servers() { - // if, for example, run with -n, list is not initialized, - // run empty nmap_mass_rdns to do so if(servs.size() == 0 && firstrun) { - nmap_mass_rdns(NULL, 0); + init_servs(); } // If the user said --system-dns (!o.mass_dns), we should never return a list Index: NmapOps.cc =================================================================== --- NmapOps.cc (revision 10844) +++ NmapOps.cc (working copy) @@ -488,8 +488,6 @@ fatal("Sorry -- IPv6 support is currently only available for connect() scan (-sT), ping scan (-sP), and list scan (-sL). OS detection and decoys are also not supported with IPv6. Further support is under consideration."); } - if (af() != AF_INET) mass_dns = false; - /* Prevent performance values from getting out of whack */ if (min_parallelism > max_parallelism) max_parallelism = min_parallelism;