[精讚] [會員登入]
716

[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

你可能感興趣的文章

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

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

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

利用openssl 一行文產生私鑰及憑證請求檔 openssl 一行產生私鑰及憑證請求檔

雲端校務系統與OPENLDAP帳號整合(2) openldap,雲端校務

windows 使用 command 移除程式 使用 command 移除程式

隨機好文

vue.js components 多個組件的呈現 vue.js 組件 component

編碼的順序 utf8 big5

讀取特定資料夾下的xls檔 讀取特定資料夾下的xls檔

雲端校務系統與OPENLDAP帳號整合(2) openldap,雲端校務

題庫批次匯入google表單 請先建一新試算表, 將題目轉成格式如下 並將網址列記下來, 後續的題目就是從此試算表讀出 題目 答案 選項一 選項二 選