tcp/ip

Benchmarking DNS on my Mac with Pi-Hole

After watching Level1Techs' THE FORBIDDEN ROUTER II - DIAL-UP BY DAWN video, I wanted to do some DNS benchmarking on my local network.

Since I run Pi-hole locally, and rely on it for local DNS resolution, I wanted to have a baseline so I could compare performance over time.

In the video, Wendell mentioned the use of Gibson's Windows-only DNS Benchmark tool. But that's Windows-only. Or maybe Linux under WINE, but definitely not a native / open source tool that's easily used across different platforms.

I looked around and settled on bulldohzer—for now, at least—as it's easy to install anywhere Node.js runs. I have Node.js installed via Homebrew on my Mac, so I just ran:

npm install --location=global bulldohzer

Then I could run a benchmark against Google and my own local DNS resolver (Pi-Hole):

Allowing anonymous IP-based access to content with Boost, subscription model

On the St. Louis Review website (case study here), which offers much of its content based on a subscription model (you must be a subscriber to access the 'premium' content), we wanted to allow those inside our network access to nodes that were marked 'subscribers-only', without having to log in to the website and maintain a user account. Here's how we did it:

1 - Modification of Custom Subscriber Access Code

Our site uses hook_nodeapi() to limit access to 'premium' or 'subscribers-only' content. We simply added in a check to see if users were coming from a certain IP address (the IP address for our corporate network):