我们已经绑定了ubuntu 12.04中的9.8.1.dfsg.P1-4ubuntu0.13,它运行在负载较重的服务器上(平均负载为0.19,0.12,0.13),并为macos和ubuntu工作站提供小型办公networking的服务请求。
我在dns服务器上运行的容器脚本中运行了一些dnstesting,并将结果推送到influxdb。
#!/bin/bash while true do rndc flush bind_timeout=$( dig @192.168.128.3 redhat.com | grep 'Query time' | awk '{ print $4 }' ) google_timeout=$( dig @8.8.8.8 redhat.com | grep 'Query time' | awk '{ print $4 }' ) yandex_timeout=$( dig @77.88.8.8 redhat.com | grep 'Query time' | awk '{ print $4 }' ) curl -i -XPOST 'http://ts.example.lab:8086/write?db=dnstest' -d "bind,server=bind,without_cache=yes value=$bind_timeout" & curl -i -XPOST 'http://ts.example.lab:8086/write?db=dnstest' -d "google,server=google,without_cache=yes value=$google_timeout" & curl -i -XPOST 'http://ts.example.lab:8086/write?db=dnstest' -d "yandex,server=yandex,without_cache=yes value=$yandex_timeout" & wait bind_timeout=$( dig @192.168.128.3 redhat.com | grep 'Query time' | awk '{ print $4 }' ) google_timeout=$( dig @8.8.8.8 redhat.com | grep 'Query time' | awk '{ print $4 }' ) yandex_timeout=$( dig @77.88.8.8 redhat.com | grep 'Query time' | awk '{ print $4 }' ) curl -i -XPOST 'http://ts.example.lab:8086/write?db=dnstest' -d "bind,server=bind,without_cache=no value=$bind_timeout" & curl -i -XPOST 'http://ts.example.lab:8086/write?db=dnstest' -d "google,server=google,without_cache=no value=$google_timeout" & curl -i -XPOST 'http://ts.example.lab:8086/write?db=dnstest' -d "yandex,server=yandex,without_cache=no value=$yandex_timeout" & wait sleep 5 done
我发现绑定的响应速度慢于8.8.8.8和77.88.8.8 。 这可以在图中看到:
在第一次请求系列之前用rndc flush
冲洗高速caching。 绑定使用谷歌8.8.8.8和8.8.4.4作为转发:
永远不要刷新运行绑定的caching。 绑定使用谷歌8.8.8.8和8.8.4.4作为转发:
在第一次请求系列之前用rndc flush
冲洗高速caching。 绑定使用更新的根服务器列表作为转发器:
永远不要刷新运行绑定的caching。 绑定使用更新的根服务器列表作为转发器:
为什么谷歌公共dns的最大查询时间(大约第一张图上的5k和第三张图的2.5k)比根服务器大?
为什么查询通过绑定比直接查询公共dns服务器慢?
在我的testing中可能是错的?
更新1
图中有20秒TTL – 这是错误的。 TTL为redhat.com是60秒。
您的testing正在测量执行查询的总时间,包括
结果非常符合预期。
因此,查询您的本地BIND服务器而不先清除caching是最快的,不受转发器configuration的影响。 清除caching并configuration为转发器的Google服务器后,查询本地BIND服务器比直接查询Google服务器要慢,因为它们会增加后端通过本地BIND服务器的开销。