Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random domain selection, support for non-standard DNS ports, and sorting results automatically #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mingaldrichgan
Copy link

The original list of 10 hardcoded domains is a biased sample of frequently visited sites, all likely to be permanent residents of most DNS resolvers' caches. In this commit, the domains are randomly chosen from OpenDNS' public top 10K and random 10K domain lists each time the test is run. (The number of domains tested can easily be customized by changing the NUM_DOMAINS2TEST value.)

This commit also adds support for providers using non-standard ports (using the standard notation e.g. 127.0.0.1:5353#mydns), which is helpful if you are running/testing several DNS resolvers locally on different ports and want to benchmark them against each other (and against public DNS resolvers).

Finally, in this commit, the results are automatically sorted by average lookup time (and the sort column is automatically calculated from NUM_DOMAINS2TEST). There are also other tweaks to the table layout.

Sample output

DOMAINS TO TEST:  (1) bild.de
                  (2) sharedcount.com
                  (3) phillipgilbertlaw.com
                  (4) martenscentre.eu
                  (5) belkin.com
                  (6) 1688.com
                  (7) digilant.com
                  (8) wenn.com
                  (9) wowace.com
                 (10) bravo.pl

                  (1)     (2)     (3)     (4)     (5)     (6)     (7)     (8)     (9)    (10)   AVERAGE
127.0.0.1       154 ms   29 ms   46 ms  465 ms   94 ms  157 ms  159 ms   29 ms   84 ms  236 ms   145.30
cloudflare       13 ms   14 ms   45 ms  139 ms   12 ms   12 ms   50 ms   12 ms   28 ms  157 ms    48.20
level3           97 ms   15 ms   37 ms  175 ms   18 ms   86 ms   13 ms   13 ms   17 ms  156 ms    62.70
google            1 ms   15 ms   29 ms  115 ms   20 ms   29 ms   15 ms    1 ms   49 ms  122 ms    39.60
quad9            95 ms   14 ms   18 ms  204 ms   13 ms  235 ms   16 ms   18 ms   18 ms  248 ms    87.90
freenom          87 ms  109 ms   52 ms  328 ms   59 ms  248 ms   26 ms   84 ms   39 ms  269 ms   130.10
opendns          12 ms   13 ms   91 ms  208 ms   12 ms   71 ms   14 ms   12 ms   15 ms  127 ms    57.50
norton           15 ms  284 ms   46 ms  135 ms   67 ms  350 ms   29 ms   77 ms  157 ms  314 ms   147.40
cleanbrowsing   359 ms   27 ms   24 ms  209 ms   19 ms  118 ms   26 ms   25 ms   28 ms  445 ms   128.00
yandex          184 ms  166 ms  264 ms  251 ms  253 ms  369 ms  173 ms  178 ms  181 ms  219 ms   223.80
adguard         209 ms  194 ms  271 ms  315 ms  195 ms  275 ms  277 ms  205 ms  352 ms  400 ms   269.30
neustar         566 ms  262 ms 1185 ms  244 ms  248 ms  254 ms 1174 ms 1174 ms  265 ms  447 ms   581.90
comodo           88 ms   22 ms  115 ms  218 ms   38 ms  153 ms  173 ms   20 ms   22 ms  903 ms   175.20

SORTED BY AVG.    (1)     (2)     (3)     (4)     (5)     (6)     (7)     (8)     (9)    (10)   AVERAGE
google            1 ms   15 ms   29 ms  115 ms   20 ms   29 ms   15 ms    1 ms   49 ms  122 ms    39.60
cloudflare       13 ms   14 ms   45 ms  139 ms   12 ms   12 ms   50 ms   12 ms   28 ms  157 ms    48.20
opendns          12 ms   13 ms   91 ms  208 ms   12 ms   71 ms   14 ms   12 ms   15 ms  127 ms    57.50
level3           97 ms   15 ms   37 ms  175 ms   18 ms   86 ms   13 ms   13 ms   17 ms  156 ms    62.70
quad9            95 ms   14 ms   18 ms  204 ms   13 ms  235 ms   16 ms   18 ms   18 ms  248 ms    87.90
cleanbrowsing   359 ms   27 ms   24 ms  209 ms   19 ms  118 ms   26 ms   25 ms   28 ms  445 ms   128.00
freenom          87 ms  109 ms   52 ms  328 ms   59 ms  248 ms   26 ms   84 ms   39 ms  269 ms   130.10
127.0.0.1       154 ms   29 ms   46 ms  465 ms   94 ms  157 ms  159 ms   29 ms   84 ms  236 ms   145.30
norton           15 ms  284 ms   46 ms  135 ms   67 ms  350 ms   29 ms   77 ms  157 ms  314 ms   147.40
comodo           88 ms   22 ms  115 ms  218 ms   38 ms  153 ms  173 ms   20 ms   22 ms  903 ms   175.20
yandex          184 ms  166 ms  264 ms  251 ms  253 ms  369 ms  173 ms  178 ms  181 ms  219 ms   223.80
adguard         209 ms  194 ms  271 ms  315 ms  195 ms  275 ms  277 ms  205 ms  352 ms  400 ms   269.30
neustar         566 ms  262 ms 1185 ms  244 ms  248 ms  254 ms 1174 ms 1174 ms  265 ms  447 ms   581.90

…ing results automatically

The original list of 10 hardcoded domains is a biased sample of frequently visited sites, all likely to be permanent residents of most DNS resolvers' caches. In this commit, the domains are randomly chosen from OpenDNS' [public top 10K and random 10K domain lists](https://github.com/opendns/public-domain-lists) each time the test is run. (The number of domains tested can easily be customized by changing the `NUM_DOMAINS2TEST` value.)

This commit also adds support for providers using non-standard ports (using the standard notation e.g. `127.0.0.1:5353#mydns`), which is helpful if you are running/testing several DNS resolvers locally on different ports and want to benchmark them against each other (and against public DNS resolvers).

Finally, in this commit, the results are automatically sorted by average lookup time (and the sort column is automatically calculated from `NUM_DOMAINS2TEST`). There are also other tweaks to the table layout.

**Sample output**
```
DOMAINS TO TEST:  (1) bild.de
                  (2) sharedcount.com
                  (3) phillipgilbertlaw.com
                  (4) martenscentre.eu
                  (5) belkin.com
                  (6) 1688.com
                  (7) digilant.com
                  (8) wenn.com
                  (9) wowace.com
                 (10) bravo.pl

                  (1)     (2)     (3)     (4)     (5)     (6)     (7)     (8)     (9)    (10)   AVERAGE
127.0.0.1       154 ms   29 ms   46 ms  465 ms   94 ms  157 ms  159 ms   29 ms   84 ms  236 ms   145.30
cloudflare       13 ms   14 ms   45 ms  139 ms   12 ms   12 ms   50 ms   12 ms   28 ms  157 ms    48.20
level3           97 ms   15 ms   37 ms  175 ms   18 ms   86 ms   13 ms   13 ms   17 ms  156 ms    62.70
google            1 ms   15 ms   29 ms  115 ms   20 ms   29 ms   15 ms    1 ms   49 ms  122 ms    39.60
quad9            95 ms   14 ms   18 ms  204 ms   13 ms  235 ms   16 ms   18 ms   18 ms  248 ms    87.90
freenom          87 ms  109 ms   52 ms  328 ms   59 ms  248 ms   26 ms   84 ms   39 ms  269 ms   130.10
opendns          12 ms   13 ms   91 ms  208 ms   12 ms   71 ms   14 ms   12 ms   15 ms  127 ms    57.50
norton           15 ms  284 ms   46 ms  135 ms   67 ms  350 ms   29 ms   77 ms  157 ms  314 ms   147.40
cleanbrowsing   359 ms   27 ms   24 ms  209 ms   19 ms  118 ms   26 ms   25 ms   28 ms  445 ms   128.00
yandex          184 ms  166 ms  264 ms  251 ms  253 ms  369 ms  173 ms  178 ms  181 ms  219 ms   223.80
adguard         209 ms  194 ms  271 ms  315 ms  195 ms  275 ms  277 ms  205 ms  352 ms  400 ms   269.30
neustar         566 ms  262 ms 1185 ms  244 ms  248 ms  254 ms 1174 ms 1174 ms  265 ms  447 ms   581.90
comodo           88 ms   22 ms  115 ms  218 ms   38 ms  153 ms  173 ms   20 ms   22 ms  903 ms   175.20

SORTED BY AVG.    (1)     (2)     (3)     (4)     (5)     (6)     (7)     (8)     (9)    (10)   AVERAGE
google            1 ms   15 ms   29 ms  115 ms   20 ms   29 ms   15 ms    1 ms   49 ms  122 ms    39.60
cloudflare       13 ms   14 ms   45 ms  139 ms   12 ms   12 ms   50 ms   12 ms   28 ms  157 ms    48.20
opendns          12 ms   13 ms   91 ms  208 ms   12 ms   71 ms   14 ms   12 ms   15 ms  127 ms    57.50
level3           97 ms   15 ms   37 ms  175 ms   18 ms   86 ms   13 ms   13 ms   17 ms  156 ms    62.70
quad9            95 ms   14 ms   18 ms  204 ms   13 ms  235 ms   16 ms   18 ms   18 ms  248 ms    87.90
cleanbrowsing   359 ms   27 ms   24 ms  209 ms   19 ms  118 ms   26 ms   25 ms   28 ms  445 ms   128.00
freenom          87 ms  109 ms   52 ms  328 ms   59 ms  248 ms   26 ms   84 ms   39 ms  269 ms   130.10
127.0.0.1       154 ms   29 ms   46 ms  465 ms   94 ms  157 ms  159 ms   29 ms   84 ms  236 ms   145.30
norton           15 ms  284 ms   46 ms  135 ms   67 ms  350 ms   29 ms   77 ms  157 ms  314 ms   147.40
comodo           88 ms   22 ms  115 ms  218 ms   38 ms  153 ms  173 ms   20 ms   22 ms  903 ms   175.20
yandex          184 ms  166 ms  264 ms  251 ms  253 ms  369 ms  173 ms  178 ms  181 ms  219 ms   223.80
adguard         209 ms  194 ms  271 ms  315 ms  195 ms  275 ms  277 ms  205 ms  352 ms  400 ms   269.30
neustar         566 ms  262 ms 1185 ms  244 ms  248 ms  254 ms 1174 ms 1174 ms  265 ms  447 ms   581.90
```
@thomasmerz
Copy link
Contributor

I like this 👍🏻 But you should use a more current base (#68) for this. @cleanbrowsing , I'm willing to add this feature into shellcheck'ed version. Do you agree, @cleanbrowsing + @mingaldrichgan ?

@mingaldrichgan
Copy link
Author

TBH it seems like forever ago I made this commit. Feel free to rebase and update it as you wish.

@thomasmerz
Copy link
Contributor

I will do after merge of #68 👍🏻
There's PR #51 which also inspired my with these random domains. Let's see what I can take from your PR… 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants