This is the first in a series of three blog posts.

Google Public DNS and OpenDNS are free DNS resolvers that anybody can use on their computer to resolve a hostname (www.example.com) to an IP address. Google and OpenDNS promise faster and safer DNS lookups and each serves billions of DNS queries every month.

It has been blogged about before that using these DNS resolvers can cause (big) problems when requesting content from CDNs, because some CDNs detect the user's location wrong and serve content from far-away servers.

We decided to investigate if this problem still exists, and if so how big the problem is. We will answer the following 3 questions:

We answer the first question in this article and the others in separate blog posts, which we hope to publish tomorrow and the day after tomorrow. Please be patient. The good stuff on CDN performance is coming ...

How many people use Google DNS and OpenDNS?

Update (Oct 17, 2012): we computed all the numbers again, after discovering we did not mark AS30607 as OpenDNS. We apologize for this mistake.

At Turbobytes, we continuously monitor the performance of CDNs to fuel our multi-CDN platform. We built a custom RUM solution for this and many websites have added our JavaScript snippet to their pages. When thinking about testing usage of Google DNS and OpenDNS and the impact on CDN performance, Sajal came up with a way to leverage our RUM user base, with the big benefit of getting a lot of measurements. Let's look at the test results first and then you can read about our test methodology.

Results

Between Oct 3 and Oct 15 2012 we ran over 3.5 million tests from around the world.

The key findings are:

8.04% of users worldwide use either Google DNS or OpenDNS

Google DNS has 2.5 times more users than OpenDNS

Popularity of these DNS services varies greatly by country

Google DNS is very popular in Vietnam, Indonesia, Turkey and Egypt

The chart below shows the 'market share' of the two DNS services in 10 large countries. China is not shown because we had a relatively small number of measurements from China.

Just by looking at these 10 countries you can see the big differences. Canada is the only country where OpenDNS is used by more people than Google DNS. United Kingdom and Australia are pretty similar, usage of bot public DNS services is relatively low in France, but high in Russia and Brazil. In India and especially Indonesia, both DNS services are used by a lot of people. View the table below to gain insight in Google Public DNS and OpenDNS usage/popularity for the 80 countries and states (US/CA) that we received most test results from.

Country/state Count Using OpenDNS Using Google DNS Using OpenDNS or Google Count Pct Count Pct Count Pct All data 3,541,208 81,292 2.30% 203,319 5.74% 284,611 8.04% United States 920,307 24,145 2.62% 30,593 3.32% 54,738 5.95% United States (California) 262,210 5,688 2.17% 9,527 3.63% 15,215 5.80% Canada 190,940 7,944 4.16% 5,675 2.97% 13,619 7.13% France 154,761 1,161 0.75% 3,139 2.03% 4,300 2.78% United Kingdom 147,626 3,110 2.11% 5,789 3.92% 8,899 6.03% Mexico 129,807 1,059 0.82% 7,522 5.79% 8,581 6.61% Indonesia 125,920 7,269 5.77% 21,676 17.21% 28,945 22.99% Philippines 118,762 3,787 3.19% 5,242 4.41% 9,029 7.60% Brazil 104,819 2,118 2.02% 9,432 9.00% 11,550 11.02% Germany 104,009 822 0.79% 4,499 4.33% 5,321 5.12% Malaysia 94,843 2,177 2.30% 10,470 11.04% 12,647 13.33% India 92,005 2,625 2.85% 5,641 6.13% 8,266 8.98% Canada (Ontario) 86,169 3,342 3.88% 2,937 3.41% 6,279 7.29% Chile 83,174 506 0.61% 1,199 1.44% 1,705 2.05% Poland 76,789 982 1.28% 6,745 8.78% 7,727 10.06% United States (Texas) 69,494 1,650 2.37% 1,895 2.73% 3,545 5.10% Italy 68,187 2,200 3.23% 4,935 7.24% 7,135 10.46% Romania 62,046 302 0.49% 3,029 4.88% 3,331 5.37% United States (New York) 61,482 1,647 2.68% 1,861 3.03% 3,508 5.71%



We will continue our DNS tests and likely publish an update to this blog post in the future.

Test methodology

Sajal used the following setup:

RUM.js. Added a few lines of code to this JS file, to send request to a random hostname for which our DNS server is the authoritative name server

HTTP server (Nginx). Returns a 204 response to all requests. Uploads logfiles to S3 every hour

Node.js based DNS server. Uses the excellent native-dns library. Gives same response with very low TTL to all queries. Echoes back the client-subnet (if any) with scope netmask of 32. Uploads logfiles to S3 every hour

Desktop. Offline analysis after downloading logfiles from S3. Using MongoDB for storage, Disco for parallel processing

The HTTP server and DNS server ran on an EC2 instance in US-East.

The first step is to get the user's IP and their resolver's IP

Generate a uuid in JavaScript using random numbers and current timestamp User tries to access http://<uuid>.example.com/foo.jpg User asks for the IP of <uuid>.example.com from the resolver configured in the user's machine The configured resolver asks our authoritative DNS server. We log the IP of resolver and the uuid here. Also log EDNS parameters if available User finally establishes HTTP connection to <uuid>.example.com. We log the IP of the user and the uuid Match users IP to resolver IP where uuid matches

Each user's IP was considered only once a day !

Step two is to match ASNs, country, etc.

We detected the ASN of the DNS resolver's IP and user's IP and then detected geo location of the user, geo location of the dns server, whether edns was used or not, the edns paramaters that came with the query and user agent. If the ASN matched Google Public DNS or OpenDNS, we used information on these webpages (Google DNS server locations, OpenDNS network map) to figure out its location.