DNS Enumeration - tmansfield42/Tech-Journal GitHub Wiki
I had a lot of trouble figuring out how to output only successful nslookups, because nslookup doesnt throw an error when it can’t find a server, in other words unsuccessful nslookups still fall under its standard output (stdout) which is why throwing the 2>/dev/null at the end didnt work as i expected.
Here's a small guide on how the /dev/null stuff works:
stdout (standard output) = normal results stderr (standard error) = error messages
using >/dev/null or 1>/dev/null will throw away normal output i.e. the stdout
2>/dev/null throws away errors (stderr)
using &>/dev/null will throw away both stdout and stderr.
lastly, /dev/null just throws out all output entirely.