time=$(dig @8.8.8.8 | grep Query | awk '{print $4}')echo $time
一nslookup指定服务器查询域名解析时间
root@X:/data# dig @114.114.114.114
; <<>> DiG 9.9.2-P2 <<>> @114.114.114.114
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21147
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;. IN A
;; ANSWER SECTION:
. 562 IN CNAME www..
www.. 34 IN A 61.135.169.121
www.. 34 IN A 61.135.169.125
;; Query time: 14 msec ---- 毫秒
;; SERVER: 114.114.114.114#53(114.114.114.114)
;; WHEN: Fri Dec 28 14:52:58
;; MSG SIZE rcvd: 101
二 nslookup指定服务器查询域名解析时间
root@X:/data# time nslookup 114.114.114.114
Server: 114.114.114.114
Address 1: 114.114.114.114
Name:
Address 1: 220.181.57.216
Address 2: 123.125.115.110
real 0m 0.03s
user 0m 0.00s
sys 0m 0.00s
参考:
/question/response-time-for-nslookup-061610
googlenslookup show query time
如果觉得《dig指定服务器查询域名解析时间》对你有帮助,请点赞、收藏,并留下你的观点哦!