Skip to content

ELowry/DNSToggle

Repository files navigation

License: MIT GitHub release (latest by date)

DNS Toggle

A tiny Android app that allows you to easily toggle your phone's Private DNS through the Quick Settings panel.

Screenshot of Private DNS being toggled on in the Quick Settings menu Screenshot of Private DNS being toggled off in the Quick Settings menu Screenshot of the DNS Toggle configuration menu Screenshot of the DNS Toggle configuration menu's rename popup

Warning

To modify the Private DNS system settings, this app requires the WRITE_SECURE_SETTINGS permission. Since this is a protected system permission, you must either have a rooted device or manually grant the permission using ADB.

If your device is not rooted, you can grant the required permission by connecting your phone to a computer with USB debugging enabled and running the following ADB command:

adb shell pm grant com.ericlowry.dnstoggle android.permission.WRITE_SECURE_SETTINGS

Features

Quick Settings Tile

Adds a Quick Settings tile to toggle your Private DNS on and off with a single tap from your notification shade.

Note

The app does not create an app drawer icon, as it is meant for use through the Quick Settings panel.

Additional Options

By long-pressing the Quick Settings tile, you can access the configuration menu to:

  • Custom DNS Provider: Set a custom hostname for Private DNS (e.g., dns.adguard.com).
  • Wi-Fi Blocklist: Automatically disable Private DNS when connected to specific Wi-Fi networks.
  • Auto-Update Blocklist: Optionally add or remove the current SSID from the blocklist automatically when manually toggling the Quick Settings tile.
  • Status Notifications: Receive notifications when Private DNS settings are automatically adjusted.
  • Dynamic Tile Labeling: Rename the Quick Settings tile label via the settings menu.

Usage

  1. Install the app on your Android device.
  2. Grant the WRITE_SECURE_SETTINGS permission using root or the ADB command provided above.
  3. Edit your Quick Settings panel and drag the DNS Toggle tile into your active tiles.
  4. Long-press the tile to open the configuration UI to set your custom DNS hostname.
  5. Tap the tile to toggle the Private DNS on or off!

Troubleshooting

  • ADB Command Fails: Ensure USB Debugging is enabled in Developer Options, and that your device is recognized by running the adb devices command.
  • Tile is Grayed Out: This usually means the permission was not granted correctly. See the warning above.

Permissions

  • WRITE_SECURE_SETTINGS: Required to modify system Private DNS settings. Must be granted via root or using ADB.
  • Location & Nearby Devices(optional): Required only for Wi-Fi Blocklist automation. Used to identify the Wi-Fi network name (SSID) locally.
  • Notifications(optional): Used for status alerts when Private DNS is automatically adjusted.

Privacy

This app is a shortcut for existing system settings. It does not store, collect, or share any personal data. All permission-related activities (such as reading the Wi-Fi SSID) occur strictly on-device for automation purposes.

Building from Source

You can build the app yourself by opening this project in Android Studio or by running ./gradlew assembleDebug using your prefered command line tool.

About

A tiny Android app to easily toggle Private DNS through Quick Settings

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors

Languages