At cPanel, we have had times when some hosting providers or data centers use their DNS resolvers tied to the network and added in the /etc/resolv.conf file on the operating system. While these systems usually work, there are times where the systems may not be running correctly or even go down for a short amount of time. One such error would be that the DNS test script below would be going through and reporting 0 ms on each result. This can occur when port 53 is closed and dig itself is having issues:
# dig google.com
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-9.P2.el7 <<>> google.com
;; global options: +cmd
;; connection timed out; no servers could be reached
During these times, the server generally is unable to go through and make requests or resolve any domain that may be out of the server. This can lead to some issues, such as email sending or validating SPF and DKIM records. Depending on the reliability of these DNS resolvers, you may want to switch to a public DNS resolver that has possibly faster response times or better uptime. However, please keep in mind, too, when making a decision that some public resolvers usually do not allow spam RBLs to function on the server. We recommend checking the exim configuration through WHM in Home >> Service Configuration >> Exim Configuration to ensure that you don't have any spam RBLs enabled.
There are quite a few different public DNS resolvers out there. Due to this, we set out to test some of the more popular public resolvers so that we had a few various speed tests to provide in case you would like to use one public DNS resolver or another.
Today, we will go through and test some of the more popular DNS resolvers available worldwide and share the results of their average response rates each provider to help you determine what services may be best for your server. Please keep mind that the server that we tested is located in Houston, TX, so your results may differ depending on your server location. Below you can find the common public DNS resolver and their average testing times:
ResolverAvg Latency
CloudFlare (1.1.1.1, 1.0.0.1) 4.66 ms
Level 3 (4.2.2.2, 4.2.2.1) 11.66 ms
OpenDNS (208.67.220.220, 208.67.222.222) 12.33 ms
Ultra (156.154.71.1, 156.154.70.1) 17.66 ms
Google (8.8.8.8, 8.8.4.4) 20.33 ms
Dyn (216.146.35.35, 216.146.36.36) 67.66 ms
Since each server and it's attached network can be set up; differently, we recommend testing the resolvers on your end as well in case that these providers may be faster then what we have experienced during our testing. Please keep in mind that any scripts mentioned in our articles are not supported by cPanel technical support. If you have issues with the script, we recommend reaching out to a Qualified System Administrator for further assistance.
The following bash script is what we had used during our testing. This should work on any server with bash and dig installed which comes on the server by default but please reach out to your system administrator if you have any issues:
#/bin/bash
DOMAIN=cpanel.net;
echo "Testing common resolvers and calculating average response times by testing each resolver 3 times. This may take a few minutes"
echo
for resolver in 8.8.8.8 4.2.2.2 1.1.1.1 208.67.220.220 156.154.71.1 216.146.35.35
do
echo $resolver
for reps in {1..3}
do
dig $DOMAIN @$resolver | awk '/time/ {print $4 " ms"}'
sleep 3
done |awk '/ms/ {sum+=$1} END {print "Ave time: ",sum/3, " ms"}'
echo
done
Once you have the list of averages set up on your system, you will be able to update the resolver IPs through WHM. To update the resolver IPs, you will need to log in to WHM as root then go to Home >> Networking Setup >> Resolver Configuration. Once on that page, you will click on Proceed and update the IPs on the page and save the new configuration. For more information about the resolver configuration settings, please refer to our documentation guide located here.
Comments
0 comments
Article is closed for comments.