DNS查詢 and trouble-shooting case
ping和host,dig,nslookup是兩種不同型別的處理DNS的方式
Trouble-shooting case
ping,首先會查詢本地的/etc/hosts檔案,然後才會查詢DNS伺服器,這樣做有啥好處?效率高。
host,dig,nslookup三個命令是一樣的,不會查詢本地的/etc/hosts檔案,如果查詢DNS伺服器沒有結果,那麼直接返回無結果,此時,即使本地有配置/etc/hosts檔案也是沒有用的。
dig 顯示域名的高階資料(功能強大,操作簡潔)
#dig 163.com
#dig 163.com -t MX(查詢163的郵件伺服器)
host 查詢主機使用的域名(簡單易用,輸出簡潔)
#host 163.com
#host -t MX 163.com
nslookup 查詢域名與地址的對應(LINUX/UNIX平臺可用dig命令代替)
#nslookup
>set type=mx
>163.com
>exit
Trouble-shooting case
while true; do curl -s -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} Size: %{size_download} \n" -H 'Host: ' <'> ;done
dns: %{time_namelookup}
while true; do curl -s -o /dev/null -w "Connect: %{time_connect} DNS: %{time_namelookup} TTFB: %{time_starttransfer} Total time: %{time_total} Size: %{size_download} \n" -H 'Host: ' <'> ;done
Long respond time from CUBE API to Epay
fzou@cnpradm01:~$ while true; do curl -s -o /dev/null -w "Connect: %{time_connect} DNS: %{time_namelookup} TTFB: %{time_starttransfer} Total time: %{time_total} Size: %{size_download} \n" -H 'Host: ';done Connect: 0.008 DNS: 0.006 TTFB: 0.011 Total time: 0.011 Size: 426
Connect: 0.002 DNS: 0.002 TTFB: 0.004 Total time: 0.004 Size: 426
Connect: 0.003 DNS: 0.002 TTFB: 0.008 Total time: 0.008 Size: 426
Connect: 5.005 DNS: 5.005 TTFB: 5.010 Total time: 5.010 Size: 426
Connect: 0.003 DNS: 0.002 TTFB: 0.006 Total time: 0.006 Size: 426
Connect: 0.002 DNS: 0.002 TTFB: 0.004 Total time: 0.004 Size: 426
Connect: 0.003 DNS: 0.002 TTFB: 0.008 Total time: 0.008 Size: 426
Connect: 5.005 DNS: 5.005 TTFB: 5.010 Total time: 5.010 Size: 426
Connect: 0.003 DNS: 0.002 TTFB: 0.006 Total time: 0.006 Size: 426
Connect: 0.002 DNS: 0.002 TTFB: 0.004 Total time: 0.004 Size: 426
Connect: 0.003 DNS: 0.002 TTFB: 0.008 Total time: 0.008 Size: 426
Connect: 5.005 DNS: 5.005 TTFB: 5.009 Total time: 5.009 Size: 426
Connect: 0.004 DNS: 0.002 TTFB: 0.006 Total time: 0.006 Size: 426
Connect: 0.002 DNS: 0.002 TTFB: 0.004 Total time: 0.004 Size: 426
Connect: 0.003 DNS: 0.002 TTFB: 0.008 Total time: 0.008 Size: 426
Connect: 5.005 DNS: 5.005 TTFB: 5.009 Total time: 5.009 Size: 426
Connect: 0.004 DNS: 0.002 TTFB: 0.007 Total time: 0.007 Size: 426
Connect: 0.002 DNS: 0.002 TTFB: 0.004 Total time: 0.004 Size: 426
Connect: 0.003 DNS: 0.002 TTFB: 0.008 Total time: 0.008 Size: 426
\ntimelookup: %{time_namelookup}\ntime_connect: %{time_connect}\ntime_appconnect: %{time_appconnect}\ntime_pretransfer: %{time_pretransfer}\ntime_redirect: %{time_redirect}\ntime_starttransfer: %{time_starttransfer}\n----------\ntime_total: %{time_total}\n\n
curl "" -H "Pragma: no-cache" -H "Accept-Encoding: gzip, deflate, sdch" -H "Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4" -H "Upgrade-Insecure-Requests: 1" -H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" -H "Cache-Control: no-cache" -H "Cookie: JSESSIONID=89ED8D62D30A1CEA8BCEED04E8B074AF.frt004" -H "Connection: keep-alive" --compressed -IL -w "@curl_display.txt"
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26477398/viewspace-2125409/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DNS查詢DNS
- DNS查詢順序DNS
- DNS 查詢原理詳解DNS
- SPF PermError:DNS 查詢過多ErrorDNS
- DNS協議 是什麼?說說DNS 完整的查詢過程?DNS協議
- YonBuilder低程式碼實戰:YonQL資料查詢小Case,讓SQL查詢變簡單UISQL
- Dog-用於DNS查詢的命令列工具DNS命令列
- nslookup命令怎麼用?如何查詢DNS解析故障?DNS
- 網站加速最佳實踐 – 減少DNS查詢網站DNS
- 在 Linux/Unix/Mac 下清除 DNS 查詢快取LinuxMacDNS快取
- 由於 DNS 查詢故障,DSA 操作無法進行DNS
- MySQL Case-information_schema檢視查詢慢處理一例MySqlORM
- SQL 部分函式的使用,子查詢,group by,虛擬欄位,case……SQL函式
- Linux DNS 查詢剖析(第三部分)LinuxDNS
- 分析“蜜罐NS”上的查詢,提升DNS日誌的質量DNS
- 一款超強的統計DNS查詢的工具--DNSTOP(轉)DNS
- SQL查詢的:子查詢和多表查詢SQL
- 查詢之折半查詢
- mysql-分組查詢-子查詢-連線查詢-組合查詢MySql
- 複雜查詢—子查詢
- 查詢——二分查詢
- 子查詢-表子查詢
- 查詢(1)--靜態查詢
- 查詢(2)--動態查詢
- MYSQL學習筆記25: 多表查詢(子查詢)[標量子查詢,列子查詢]MySql筆記
- 資料庫 - 連線查詢、巢狀查詢、集合查詢資料庫巢狀
- 離線查詢與線上查詢
- 【SQL查詢】集合查詢之INTERSECTSQL
- 查詢與排序02,折半查詢排序
- 2020年訪問根伺服器的DNS查詢銳減41%伺服器DNS
- 查詢
- #查詢演算法#【1】簡單查詢:順序、折半查詢演算法
- oracle 精確查詢和模糊查詢Oracle
- 查詢演算法__插值查詢演算法
- pgsql查詢優化之模糊查詢SQL優化
- MySQL - 資料查詢 - 簡單查詢MySql
- Elasticsearch複合查詢——boosting查詢Elasticsearch
- MySQL聯結查詢和子查詢MySql