[精讚] [會員登入]
379

[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

你可能感興趣的文章

apache 反向代理 80轉443轉8080 apache, proxy pass

臺中市雲端校務系統與Windows AD帳號整合(4) 雲端校務系統與Windows AD的架構

使用expect及 openssl 產生SSL 憑證簽署要求 每年都要製做tls 憑證 二十幾張, 此語法利用expect 產生私錀及憑證請求檔 #!/usr/bin/expect

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

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

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

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

利用maven建立一個可執行的jar檔 利用maven建立一個可執行的jar檔

axios vuejs application/x-www-form-urlencoded 送資料 VUE.JS 以 application/x-www-form-urlencoded 送資料

Arrays.asList 後想再add出現 UnsupportedOperationException 這個問題真是搞死我了 List<String> fruits = Arrays.asList("a

對照mac address 批次更改電腦名稱 讀取mac address 對照表, 還原電腦後,自動更改密碼 'show logged on user Dim