Block Ads on Windows: The Complete Guide

🖥️ Windows📅 October 16, 2026⏱ 20 min read📚 Beginner — Advanced

Introduction

Windows is the most widely used desktop operating system in the world, and Microsoft has increasingly injected advertising into the operating system itself — from Start menu recommendations and lock screen “tips” to Edge browser pop-ups and notification suggestions. Combined with web ads, in-app ads, and tracking scripts, Windows users face more advertising touchpoints than users of any other platform.

The good news is that Windows also offers the most powerful ad-blocking tools available on any platform. You have access to the strongest browser extensions (uBlock Origin), a fully editable hosts file, advanced DNS configuration, PowerShell automation for bulk changes, and system-wide network filtering tools. This guide covers every method, from quick browser-based solutions to comprehensive system-level blocking.

Whether you are running Windows 10 or Windows 11, a desktop PC or a laptop, this guide will help you create a clean, ad-free, privacy-respecting computing environment. Every method is tested on real hardware running the latest Windows builds.

💡

Quick win: Install uBlock Origin in your browser. It takes one click and blocks 99%+ of web ads instantly. Then follow the Windows privacy settings section to disable OS-level ads.

Microsoft Edge Ad Blocking

Microsoft Edge is the default browser on Windows and is based on Chromium. It supports the same extension ecosystem as Chrome, which means you can install powerful ad blockers directly from the Edge Add-ons store.

1

Open Edge Add-ons

Click the three-dot menu in Edge → Extensions → Get extensions for Microsoft Edge.

2

Install uBlock Origin

Search for “uBlock Origin” and click “Get.” Confirm the installation when prompted.

3

Pin and Configure

Click the Extensions icon (puzzle piece) in the toolbar and pin uBlock Origin. Click the icon to verify it is active.

⚠️

Manifest V3 impact: Like Chrome, Edge is transitioning to Manifest V3 which limits ad-blocker capabilities. For the strongest ad blocking on Windows, consider switching to Firefox.

Chrome Ad Blocking

Google Chrome remains the most popular browser on Windows. Installing uBlock Origin from the Chrome Web Store is the fastest path to ad-free browsing.

1

Visit Chrome Web Store

Navigate to chrome.google.com/webstore and search “uBlock Origin.”

2

Add to Chrome

Click “Add to Chrome” → “Add Extension.” uBlock Origin is now active.

3

Advanced Configuration

Click the uBlock Origin icon → Dashboard → Filter Lists. Enable additional lists under “Annoyances” to block cookie consent dialogs and social media embeds.

Firefox Ad Blocking

Firefox on Windows provides the strongest ad-blocking experience of any browser. Mozilla has committed to maintaining full support for Manifest V2 extensions, which means uBlock Origin runs at full power on Firefox without the limitations Google is imposing on Chrome and Edge.

If ad blocking is your priority, Firefox + uBlock Origin is the undisputed best combination on Windows.

1

Install Firefox

Download Firefox from mozilla.org if not already installed.

2

Install uBlock Origin

Open Firefox → Menu → Add-ons and Themes → search “uBlock Origin” → Add to Firefox.

3

Enable Strict Tracking Protection

Go to Firefox Settings › Privacy & Security → set Enhanced Tracking Protection to “Strict.”

Hosts File Method

The Windows hosts file maps domain names to IP addresses at the OS level. By mapping ad domains to 0.0.0.0, you block those domains across all browsers and applications on your system.

Editing the Hosts File

Windows PowerShell (Run as Administrator)
# Open hosts file in Notepad (as Admin)
notepad C:\Windows\System32\drivers\etc\hosts

# Add ad-blocking entries:
# 0.0.0.0 ads.google.com
# 0.0.0.0 pagead2.googlesyndication.com
# 0.0.0.0 ad.doubleclick.net
# 0.0.0.0 analytics.google.com

# Save and flush DNS:
ipconfig /flushdns

Automated Hosts File with PowerShell

Windows PowerShell — Auto-Update Hosts
# Download Steven Black's unified hosts (170K+ blocked domains)
$hostsUrl = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
$hostsPath = "$env:SystemRoot\System32\drivers\etc\hosts"

# Backup current hosts
Copy-Item $hostsPath "$hostsPath.backup" -Force

# Download and install
Invoke-WebRequest -Uri $hostsUrl -OutFile $hostsPath

# Flush DNS cache
ipconfig /flushdns

# Count blocked domains
$count = (Get-Content $hostsPath | Select-String "0.0.0.0" | Measure-Object).Count
Write-Host "Blocking $count ad domains"
⚠️

Important: You must run Notepad, PowerShell, or your text editor as Administrator to modify the hosts file. Some antivirus software may flag hosts file modifications.

DNS Configuration

Changing your Windows DNS settings to use an ad-blocking DNS provider is an effective system-wide solution that works across all browsers and many apps.

1

Open Network Settings

Go to Settings › Network & Internet › Wi-Fi or Ethernet › Hardware Properties › DNS Server Assignment › Edit.

2

Set DNS Manually

Switch from “Automatic” to “Manual.” Enable IPv4. Set Preferred DNS to 94.140.14.14 (AdGuard) and Alternate DNS to 94.140.15.15.

3

Flush DNS Cache

Open PowerShell and run:

Windows PowerShell
ipconfig /flushdns

System-Wide Ad Blocking

AdGuard for Windows

AdGuard for Windows is a full-featured ad blocker that filters all network traffic at the system level. It blocks ads in all browsers (without extensions), in desktop apps, in games, and in Windows system components. It includes HTTPS filtering, a customizable filter engine, and parental controls.

Pi-hole on Your Network

Running Pi-hole on a Raspberry Pi or in a Docker container on your network provides DNS-level ad blocking for all devices, including your Windows PC. Once set up, it protects every device on your network automatically.

Windows Privacy Settings (Disable OS Ads)

Windows 10 and 11 serve various forms of advertising within the operating system itself. Disabling these is essential for a clean Windows experience:

Start Menu Suggestions

Go to Settings › Personalization › Start and toggle off “Show suggestions occasionally in Start” (Windows 10) or “Show recommendations” (Windows 11).

Lock Screen Ads

Navigate to Settings › Personalization › Lock Screen. Change background from “Windows Spotlight” to “Picture” or “Slideshow.” Toggle off “Get fun facts, tips, tricks, and more on your lock screen.”

Notification Ads

Go to Settings › System › Notifications and toggle off “Get tips and suggestions when using Windows” and “Show me the Windows welcome experience.”

Advertising ID

Navigate to Settings › Privacy & Security › General and toggle off “Let apps show me personalized ads by using my advertising ID.”

Diagnostic Data

Go to Settings › Privacy & Security › Diagnostics & Feedback and set to “Required diagnostic data only.” Toggle off “Tailored experiences.”

PowerShell Automation

Automate privacy and ad-blocking configurations using PowerShell:

Windows PowerShell — Disable Windows Ads
# Disable Advertising ID
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Value 0

# Disable Start Menu suggestions
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -Value 0

# Disable lock screen tips
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "RotatingLockScreenOverlayEnabled" -Value 0

# Disable Get tips notifications
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SoftLandingEnabled" -Value 0

Write-Host "Windows advertising features disabled"

Network-Level Blocking

Configure your router to use ad-blocking DNS (AdGuard DNS: 94.140.14.14 / 94.140.15.15) or deploy Pi-hole/AdGuard Home on your local network. This protects your Windows PC along with every other device on your network.

Troubleshooting

Hosts File Changes Not Taking Effect

  • Ensure you saved the file as Administrator
  • Run ipconfig /flushdns after every change
  • Check that your antivirus is not reverting the hosts file
  • Verify no trailing spaces or incorrect formatting

uBlock Origin Not Blocking All Ads

  • Update filter lists: click uBlock icon → click the refresh icon
  • Enable additional filter lists in the Dashboard
  • Clear your browser cache
  • Check that no other extensions are conflicting

DNS Changes Reverting After Restart

  • Some VPN software overrides DNS settings
  • Use netsh to set DNS permanently via command line
  • Check router DHCP settings

Method Comparison

MethodBlocks Web AdsBlocks App AdsBlocks OS AdsDifficulty
Browser Extension✅ Yes❌ No❌ NoBeginner
DNS Configuration✅ Yes✅ Partial❌ NoBeginner
Hosts File✅ Yes✅ Yes❌ NoIntermediate
Windows Settings❌ No❌ No✅ YesBeginner
AdGuard for Windows✅ Yes✅ Yes❌ NoBeginner
Pi-hole (Network)✅ Yes✅ Partial❌ NoAdvanced

Best Practices

  • Install uBlock Origin in Firefox for the most powerful browser-based ad blocking available
  • Disable all Windows advertising features using the privacy settings or PowerShell script above
  • Configure DNS to an ad-blocking provider for system-wide protection beyond the browser
  • Keep a hosts file backup before modifications
  • Use the PowerShell automation script to quickly configure new Windows installations
  • Review privacy settings after major Windows updates — Microsoft sometimes resets settings
  • Combine methods: Browser extension + DNS blocking + Windows privacy settings = comprehensive protection

Frequently Asked Questions

Does modifying the hosts file affect Windows Update?

Reputable hosts files are careful not to block Microsoft update domains. Always use a well-maintained, community-reviewed hosts file, and keep a backup of the original.

Can I block Microsoft’s own ads in Windows?

Yes, partially. The Windows privacy settings above disable most OS-level advertising. However, some Microsoft promotions (like OneDrive upsells) are deeply integrated and harder to completely eliminate without third-party tools.

Is it better to use DNS or hosts file?

Both have advantages. DNS blocking is easier to set up and maintain. Hosts file blocking works even when your DNS provider is unreachable and has zero network latency. For maximum coverage, use both simultaneously.

Will ad blocking affect my gaming?

Browser-based ad blocking has zero impact on gaming. DNS and hosts file blocking may occasionally interfere with free-to-play games that use ad-serving domains for rewarded ads. If a game breaks, whitelist its domains.