I'm trying to make a shell script to do a reverse DNS lookup but I can't get it to work.
Basically I want to do this:
dig -x 126.96.36.199 +short
The output will be this:
I want to send that to an output file.
At the moment my code looks like this.
#!/bin/bash #Read a file where per line there will be an IP address. The .in file is the input/sourcelist from which IP addresses are read cat reverse_dns_lookup.in | while read line # do # Do a reverse lookup dig -x $line +short done
When I run the script it seems nothing is happening, so my thought was that I would not call
dig but first test the script like this:
echo dig -x $line +short
Even this does not produce any output. What am I missing here?