DNS查询 and trouble-shooting case

ping和host,dig,nslookup是两种不同类型的处理DNS的方式

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: www.decathlon.fr' <http://www.decathlon.fr'> http://cnprfront.epay-net.org;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:  www.cnprfront.epay-net.org' < http://www.cnprfront.epay-net.org'>  http://cnprfront.epay-net.org;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:  cnprfront.epay-net.org' http://cnprfront.epay-net.org;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

\n
             timelookup:  %{time_namelookup}\n
               time_connect:  %{time_connect}\n
            time_appconnect:  %{time_appconnect}\n
           time_pretransfer:  %{time_pretransfer}\n
              time_redirect:  %{time_redirect}\n
         time_starttransfer:  %{time_starttransfer}\n
                            ----------\n
                 time_total:  %{time_total}\n
\n

curl " http://cnprfront.epay-net.org/easypay-server-mvc/api/payments?clientName=CUBECN&orderAmount=0.0&channelType=WEB&oneClick=-1&privateCustomer=-1&professionalCustomer=-1&forLoyaltyCustomer=-1&forNotLoyaltyCustomer=-1?ularDelivery=-1&paymentOnDelivery=-1" -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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26477398/viewspace-2125409/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值