Answer the question
In order to leave comments, you need to log in
How to cut extra from ANSWER SECTION to dig?
My question is this. I execute a request -
dig +nocmd -x 94.100.180.201 +noall +answer
I receive a response -
201.180.100.94.in-addr.arpa 2312 IN PTR mail.ru.
Answer the question
In order to leave comments, you need to log in
Here is a 100% working solution.
#!/bin/bash
cat ip_list.txt | while read LINE; do
ip=`echo ${LINE}|awk '{print $1}'`
fqdn="$(/usr/bin/dig -x $ip +short| head -n 1)"
echo "$ip $fqdn"
done>ip_to_fqdn.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question