Join GitHub today
Nmap on Windows: use appropriate DNS servers for the target address #1349
While investigating #1328, I realized that Nmap may be choosing the "wrong" DNS servers in some cases. Imagine a Windows system connected to several different networks: maybe a VPN, WiFi, and a wired network. The user scans a target on the WiFi network, and Nmap tries to do reverse-DNS lookup of the address. But it retrieves the list of DNS servers from all configured network interfaces and distributes PTR requests across them all. The request may very well go to the VPN's DNS server or the wired Ethernet connection's server.
I propose trying to identify the interface for the target (I think we already track this internally) and using the appropriate servers for that interface, unless