Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dns response checker script #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions scripts/dns_response
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
TMP=:
while read -r domain
do
while read -r server
do
response_time="$(drill @$server $domain | grep -o "Query time: [0-9]*" | grep -o "[0-9]*")"
echo "$server-> $domain::$response_time"
TMP+="$server,$domain,$response_time""\\n"
done < servers.txt
echo
done < domains.txt
echo
# echo -e "$TMP"
while read -r server
do
echo "$server ->>>>"
echo -n "avg:"
echo "$(echo -e $TMP |grep $server |cut -d ',' -f 3 |awk 'NF{sum+=$1} END {print sum}')"/"$(wc -l domains.txt|grep -o "[0-9]*")"|bc
echo -e $TMP |grep $server |cut -d ',' -f 3 |sort -n |echo min:$(head -1)
echo -e $TMP |grep $server |cut -d ',' -f 3 |sort -n |echo max:$(tail -1)
echo -e $TMP|grep $server |cut -d ',' -f 3|sort -n |uniq -c |awk '{$2=$2"->"$1;$1="";print} '
echo
done <servers.txt
exit

51 changes: 51 additions & 0 deletions scripts/domains.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
aliexpress.com
amazon.com
americanas.com.br
apple.com
baidu.com
bb.com.br
bing.com
bradesco.com.br
caixa.gov.br
cnn.com
correios.com.br
craiglist.org
dx.com
ebay.com
espn.com
facebook.com
fazenda.gov.br
gearbest.com
github.com
globo.com
gmail.com
goo.gl
google.com
imgur.com
itau.com.br
linkedin.com
live.com
live.com
mec.gov.br
mercadolivre.com.br
microsoft.com
netflix.com
olx.com.br
outlook.com
pagseguro.uol.com.br
paypal.com
raspberrypi.org
reddit.com
salesforce.com
snapchat.com
stackoverflow.com
t.co
tumblr.com
twitch.tv
twitter.com
uol.com.br
whatsapp.com
wikipedia.org
yahoo.com
youtube.com

4 changes: 4 additions & 0 deletions scripts/servers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1.1.1.1
8.8.8.8
9.9.9.9
208.67.222.222