1. Sample host
[root@server-teguht teguht]# cat hostdomain.txt
www.example.com
example.com
a.example.com
aaa.example.com
aaaa.example.com
example.com
info.example.com
cname.example.com
examplealias.example.com
[root@server-teguht teguht]#
2. Create script multidig
[root@server-teguht teguht]# cat digmultiple.sh
#!/bin/bash
file=$1
#while IFS= read -r line;
for j in 'cat $1'
do
i='echo $j | sed 's/\r//g''
dig @1.1.1.1 $i
done
[root@server-teguht teguht]#
3. execure script to multidig
[root@server-teguht teguht]# sh digmultiple.sh hostdomain.txt | grep opcode > result.txt
[root@server-teguht teguht]#
4. check result multidig
[root@server-teguht teguht]# cat result.txt
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 31465
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 8338
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 21782
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 14564
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 17515
[root@server-teguht teguht]#
5. check total to compare hostdomain and result
[root@server-teguht teguht]# cat result.txt | grep -i nxdomain | wc -l
5
[root@server-teguht teguht]# cat result.txt | grep NXDOMAIN | wc -l
5
[root@server-teguht teguht]#
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Sertifikasi profesional, kadang hanya disebut dengan sertifikasi atau kualifikasi saja, adalah suatu penetapan yang diberikan oleh ...
-
SQL atau Structured Query Language) adalah sebuah bahasa yang digunakan untuk mengakses data dalam basis data relasional. Bahasa ini sec...
-
bagaimana cara mengubah hostid di Solaris The Hostid is a globally unique ID for a Sun Solaris Machine. Sometimes, you need to change t...
-
DNSPerf and ResPerf are free tools developed by Nominum that make it simple to gather accurate latency and throughput metrics for Domain ...
-
1. Check Host ID Solaris The Hostid is a globally unique ID for a Sun Solaris Machine. Sometimes, you need to change this hostid for ...
No comments:
Post a Comment