After a successful morning fiddling with my Hackintosh’s wifi and bluetooth antennae (took download speeds from 5mbps -> 100mbps+), I was hungry for more networking gains.

Cloudflare just launched a new DNS service, that claims to never log IP addresses. I like that sort of thing. But I want to know how fast it is. So how do you test DNS speed?

Using a tool from Google called namebench. Here’s how to use it on macOS.

First, install namebench.

$ brew install namebench

Then, figure out what your current DNS servers are, to test those as a baseline. Go to System Preferences, click Network, click Advanced, then select the DNS tab.

Screen Shot 2018-04-18 at 12.57.23 PM

If you prefer to stick to the command line, this will do the trick instead:

$ scutil --dns | grep 'nameserver\[[0-9]*\]' | cut -d " " -f 5 | sort | uniq

Screen Shot 2018-04-18 at 1.03.58 PM.png

Now, run namebench, with those DNS servers, plus any others you want to test. I added and (Google DNS). NOTE: this is going to use your Google Chrome browsing history to fire off a bunch of queries. If you don’t use Chrome, the resulting data won’t be very useful.

namebench --open_webbrowser --only 2001:578:3f::30 2001:578:3f:1::30

Screen Shot 2018-04-18 at 1.11.31 PM.png

That runs for a while then dumps a bunch of output, and should open a web browser with even more. The “open a web browser” part didn’t work for me, but you can find the webpage it produces and open it yourself.

Screen Shot 2018-04-18 at 1.12.31 PM.png