nmap is not able to resolve hostname if dns server reply is more than 512 bytes.nmap expects reply from dns server side in the form of UDP Packet but if size is more than 512 bytes then it is failed to process data so it is not able to resolve hostname.
Steps to Reproduce:
It is not returning hostname in case if dns packet reply size is more than 512 bytes.
It should send the query on tcp also in case if size is more than 512 bytes as glibc does in case of using --system-dns in nmap command
Reported earlier as #103. We added support for parsing truncated replies, which helps somewhat, but did not implement TCP fallback. The reverse DNS code in nmap_dns.cc is quite modular, so it shouldn't be too difficult to implement this.
Falls back to "getnameinfo" for truncated replies in reverse DNS reso…
…lver. Closes #434 and #400, fixes #364 and #103.