So my bash scripting is not the best, but the following script takes IP addresses from a text file and feeds the output to a shell and shows only the dns host names that resolve.
#!/bin/bash while read line do dig @22.214.171.124 -x "$line" +short done
and the output would look like:
one.foo.local two.foo.local three.foo.local
How can I also print the ip address for the address that resolve to a dns name on the same line so it would appear like:
one.foo.local 126.96.36.199 two.foo.local 188.8.131.52 three.foo.local 184.108.40.206