Skip to content

osmanonurkoc/AdBlockDNS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ System Security Manager (AdBlock & DNS Tool)

A lightweight, portable, and open-source PowerShell tool designed to enhance your system's privacy and security. It allows you to easily switch DNS providers and block advertisements/trackers system-wide using the Hosts file.

Download Latest Release

License Platform PowerShell Downloads Release

📸 Screenshots

Application Interface Application Interface Application Interface Application Interface The modern, dark/light-themed UI allowing quick DNS toggling and host file updates.

✨ Features

  • 🌐 DNS Manager: - Quickly switch between popular DNS providers (Google, Cloudflare, Quad9, AdGuard, OpenDNS).
    • Easily revert to Default (DHCP) with a single click.
  • 🚫 System-Wide AdBlocker: - Blocks ads, trackers, and malicious domains by modifying the Windows hosts file.
    • Aggregates blocklists from trusted sources (StevenBlack, AdAway, Yoyo).
  • 🧠 Smart Merge Logic: - Preserves your data: If you have custom entries in your hosts file (e.g., for local development), this tool will not delete them. It only manages its own blocklist section.
  • 🎨 Modern UI: - Clean WPF-based Graphical User Interface.
    • Auto-Theme: Automatically adapts to your Windows Light or Dark mode settings.
  • 📦 Portable: - Single .ps1 file. No installation required.

🚀 Getting Started

Prerequisites

  • OS: Windows 10 or Windows 11 (64-bit required).
  • Permissions: Must be run as Administrator (required to modify Network settings and System files).

Installation & Usage

Option 1: Using the Executable (Recommended)

  1. Download the latest AdBlockDNS.exe from the Releases Page.
  2. Double-click AdBlockDNS.exe to run.

Option 2: Running the Script (For Developers)

  1. Download the source code.
  2. Right-click AdBlockDNS.ps1 and select Run with PowerShell.
    • Note: If you encounter an Execution Policy error, run this command in PowerShell once:
      Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

⚠️ Antivirus Warnings (False Positives)

You may notice that some antivirus engines (such as Windows Defender, SentinelOne, or CrowdStrike) flag the .exe release of this tool as suspicious (e.g., Trojan:Win32/Wacatac, MachineLearning/Anomalous, or Generic.Malware).

This is a known False Positive.

Why is this happening?

This application is originally a PowerShell script converted into an executable (.exe) to make it easier to run. Modern antivirus "AI" and "Heuristic" engines often aggressively block any unsigned program that executes PowerShell commands internally, classifying them as "droppers" or "loaders" by default, even if the code itself is completely safe.

I don't trust the EXE. What should I do?

Since this project is open-source, you do not have to use the EXE file.

If your antivirus blocks the executable or if you prefer full transparency, you can run the source script directly:

  1. Download the .ps1 file from this repository.

  2. Right-click the file and select Run with PowerShell.

  3. (Note: You may need to enable script execution by running Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser in PowerShell once).

We provide the compiled .exe solely for convenience (icon support, double-click execution). The code logic is identical to the .ps1 script.

🛠️ How It Works

  1. DNS Changer: Uses native PowerShell commands (Set-DnsClientServerAddress) to change the DNS servers of your active network adapter.
  2. Hosts Blocker: - Downloads raw text lists of ad-servers.
    • Parses and formats them into a Windows-compatible format.
    • Appends them to C:\Windows\System32\drivers\etc\hosts inside a tagged block.
    • Creates a backup (hosts.bak) automatically before the first run.

⚠️ Disclaimer

This tool modifies system files (hosts) and network settings. While it includes safety features (backups and smart merging), use it at your own risk.

  • Always ensure you have a system restore point if you are unsure.
  • VPNs or other security software might conflict with DNS settings.

📄 License

This project is licensed under the MIT License.


Created by @osmanonurkoc

Sponsor this project

 

Packages

 
 
 

Contributors