[精讚] [會員登入]
700

[shell script] 批次判斷domain name 正解設定

判斷dns 正解設定

分享此文連結 //n.sfs.tw/14790

分享連結 [shell script] 批次判斷domain name 正解設定@igogo
(文章歡迎轉載,務必尊重版權註明連結來源)
2020-11-04 15:29:43 最後編修
2020-10-30 14:54:31 By igogo
 

 

 

這是一段描述如何找出名單中已成功設定domain name 指向 140.128.53.34 的script

ipv4

#!/bin/bash
filename='list.txt'

exec < $filename

while read line
do
        nslookup $line | grep 140.128.53.34
        if [ $? == 0 ]
        then
                echo $line >> ok_result.txt
        fi
        sleep 1
done

 

grep 符合字串成功的回傳值為 0

藉由 $?  可以得知回傳值

 

ipv6 使用dig

#!/bin/bash
filename="list.txt"
ipv6="2001:288:5400:d::34"

exec < $filename

while read line
do
        #dig lxes.tc.edu.tw AAAA | grep 2001:288:5400:d::34
        dig $line "AAAA"| grep $ipv6
        if [ $? == 0 ]
        then
                echo $line >> ok_result6.txt
        fi
        sleep 0.5
done

 

 

END

你可能感興趣的文章

使用vbs設定windows 10 靜態IP setting static ip Set Adapter = GetObject("winmgmts:Win

在docker裡跑spring boot+mongo(一) 系統安裝docker ce centos7 + docker ce https://docs.docker.com/in

臺中市雲端校務系統與Windows AD帳號整合(5) 安裝java環境

centos 7 移机出現 dracut-initqueue timeout centos 7 移机出現 dracut-initqueue timeout 處理

資料表更改為多個primary key, MariaDB [database]> describe TABLENAME; 想由本來是兩個PRIMARY KE

批次檢查tls憑證是否過期 tls憑證一年一簽, 台中市有三百多所學校, 寫成一檔案 skaps.tc.edu.tw www.skaps.tc.ed

隨機好文

[vue.js] 動態的props 做parent-child components 雙向綁定 vue.js props components camel-case

vue.js component 在parent與child 傳值 component 在parent與child 傳值

scratch3 計算得分排名 scratch3 得分排名

管理Google共用雲端硬碟 管理Google共用雲端硬碟

利用expect script 查詢ap數量,再送到google sheet及line群組通知 利用expect script 查詢ap數量