Answer the question
In order to leave comments, you need to log in
Reverse DNS query automation?
I have a heavily stuffed Nginx config because I really don't like bad bots.
one of the conditions in the config I collect in a separate log requests from bots that mow down the useragen for search bots, but they are not.
But since the subnets of search engines can change, I would like to set up an automatic check, for example, the top 10 IP from this log.
Please help me write a bash script to automate the check.
For example, such a team
cat /var/log/nginx/access.zakos_pod_good_bot.log | awk '{if ($9=="503") {print $1}}' | sort | uniq -c | sort-nr | head
#!/bin/bash
cat /var/log/nginx/access.zakos_pod_good_bot.log | awk '{if ($9=="503") {print $1}}' | sort | uniq -c | sort-nr | head > dns.txt
host 95.213.246.202
Host 202.246.213.95.in-addr.arpa. not found: 3(NXDOMAIN)
yandex.ru
google.com
host 37.9.113.197
197.113.9.37.in-addr.arpa domain name pointer 37-9-113-197.spider.yandex.com.
host 66.249.76.57
57.76.249.66.in-addr.arpa domain name pointer crawl-66-249-76-57.googlebot.com.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question