DEV Community

Hamdi
Hamdi

Posted on

Building a NextDNS Alternative: Dual-Engine Android, Zero-App iOS Adblocking, and Router DNS

(Hi DEV community! I'm a solo developer working on network security. I wanted to share a privacy ecosystem I built to fix my own mobile ad-blocking issues.)

Running a Pi-hole, AdGuard Home, or an OpenWrt router with custom blocklists is the perfect setup for home networks. But the problem is, you lose all that protection the moment you switch to mobile data.

While cloud DNS resolvers like NextDNS are great alternatives, relying completely on remote servers adds latency. I wanted the zero-latency speed of local filtering on my Android phone, combined with the power of cloud DNS for my Apple devices and home router.

Since I couldn't find a single platform that did all of this, I built GateDNS.

GateDNS Dashboard Overview

Here is how I designed the architecture to handle DNS filtering across different platforms without draining battery life.

1. Android: Local VpnService & Dedicated Cloud

I didn't want to force users into a single method, so the Android app has two different modes:

  • Mode 1: Local Loopback (VpnService): For maximum speed, the app intercepts port 53 locally on your device. Trackers and ad networks are blocked instantly before the request even leaves your phone. To keep blocklists fresh, this engine silently fetches updates in the background every single hour.
  • Mode 2: Dedicated Encrypted Cloud (DoH & DoT): For users who want upstream privacy, you can switch to native DNS-over-HTTPS or DNS-over-TLS. Instead of routing you through generic corporate servers, your traffic goes to my dedicated cloud filtering engine. It's built specifically to aggressively destroy telemetry and ads, taking the processing load off your phone.

GateDNS Android Application Interface

2. Apple iOS: Zero-App Adblocking

Most VPN adblockers on iOS drain your battery and deal with strict Apple sandboxing. I bypassed this by using native Apple .mobileconfig profiles.

  • No Battery Drain: There are no background VPN apps running on your iPhone or iPad.
  • System-Wide Blocking: Because we enforce encrypted DNS directly at the iOS level, ads and trackers are blocked in Safari, third-party apps, and mobile games natively.

3. OpenWrt and Legacy Router Support

I wanted this to cover my entire home network too:

  • Modern Routers: You can easily set up encrypted TLS pipelines directly on OpenWrt, AsusWRT, or Keenetic routers.
  • Legacy ISP Modems (DDNS): If your stock ISP modem doesn't support modern DoH/DoT, you can link your external IPv4 address via DDNS. Just point the old router's DNS to the GateDNS servers, and it will instantly protect your Smart TVs, IoT devices, and consoles.

4. Cloud Analytics & Network Control

While the Android Local Mode runs completely log-free for maximum privacy, using the Cloud/Router Mode unlocks a deep web dashboard at gatedns.app:

  • Network Metrics: View 24-hour traffic charts and your Top 10 blocked domains. The dashboard also calculates exactly how much bandwidth and web-loading time you saved by blocking ad scripts.
  • Time-Based App Blocker: Set up schedules to block distracting apps or social media domains during work hours.
  • Family Filters: Turn on network-wide Safe Search and block adult content with one click.

GateDNS Analytics Dashboard

Wrapping Up

By combining local Android filtering, iOS configuration profiles, and DDNS router support, you can get complete control over your network traffic anywhere you go.

If you are looking for a NextDNS or Pi-hole alternative that covers both mobile and home networks, check out the project at gatedns.app. You can also find the Android app on the Google Play Store.

I’d love to hear your feedback or answer any architectural questions in the comments!

Top comments (0)