Map 16,024+ AI-tool domains to 0.0.0.0 and block every chatbot, code assistant, and image generator — no appliance, no agent, no cloud dependency.
0.0.0.0, the TCP connection drops instantly — zero packets sent. The user sees "site can't be reached."
| Attribute | 0.0.0.0 | 127.0.0.1 |
|---|---|---|
| Failure speed | Instant — non-routable meta-address | May hang 30 s waiting for a local response |
| Local web server conflict | No conflict — address is never routable | May return a response from a local server |
| Recommended for blocking | Yes — superior choice | Not ideal |
DNS sinkholing redirects queries for unwanted domains to a controlled IP — a null route, loopback, or a server that logs the request and serves a block page.
Hosts file blocking is the simplest variant. It runs directly on the endpoint with no infrastructure — ideal for small IT teams, homelabbers, and environments where a dedicated DNS filtering appliance is impractical.
The hosts file format is identical on every OS: each line contains an IP address followed by one or more hostnames. Lines starting with # are comments.
Editing requires administrative privileges on all platforms — a natural layer of tamper resistance.
C:\Windows\System32\drivers\etc\hosts
ipconfig /flushdns after changes
/etc/hosts
sudo nano /etc/hosts
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
/etc/hosts
sudo nano /etc/hosts
nsswitch.conf)
sudo systemctl restart systemd-resolved
Each domain gets its own line, mapped to 0.0.0.0. Wildcards are not supported — every subdomain must be listed explicitly.
Our feed includes both root domains and all known subdomains. For example, OpenAI requires entries for openai.com, chat.openai.com, api.openai.com, platform.openai.com, and several CDN subdomains.
# AI Tools Blocklist — Hosts File Format # Generated by aitoolsblocklist.com # Last updated: 2026-07-09 # Total entries: 16,024+ # --- AI Chatbots --- 0.0.0.0 chat.openai.com 0.0.0.0 openai.com 0.0.0.0 api.openai.com 0.0.0.0 platform.openai.com 0.0.0.0 claude.ai 0.0.0.0 anthropic.com 0.0.0.0 api.anthropic.com 0.0.0.0 gemini.google.com 0.0.0.0 bard.google.com 0.0.0.0 perplexity.ai # --- AI Code Assistants --- 0.0.0.0 copilot.github.com 0.0.0.0 codeium.com 0.0.0.0 tabnine.com 0.0.0.0 cursor.sh 0.0.0.0 replit.com # --- AI Image Generators --- 0.0.0.0 midjourney.com 0.0.0.0 stability.ai 0.0.0.0 leonardo.ai 0.0.0.0 ideogram.ai # ... 16,024+ total entries across 18 categories
Hosts files do not support wildcard entries like 0.0.0.0 *.openai.com. Each subdomain requires an explicit line.
Our feed includes all known subdomains — API endpoints, CDN domains, authentication servers, and asset hosts. Missing a single subdomain can leave a path for partial operation, which is why a manually maintained hosts file is insufficient for serious AI-tool blocking.
This Bash script downloads the latest AI-tool domains, converts them to hosts format, and preserves your custom entries. Schedule it daily via cron.
A backup of the existing hosts file is created before every update for easy rollback.
#!/bin/bash # ai-hosts-update.sh — Daily hosts file update for AI tool blocking # Add to cron: 0 4 * * * /usr/local/bin/ai-hosts-update.sh API_KEY="YOUR_API_KEY" HOSTS_FILE="/etc/hosts" BACKUP_DIR="/var/backups/hosts" MARKER_START="# === AI TOOLS BLOCKLIST START ===" MARKER_END="# === AI TOOLS BLOCKLIST END ===" # Create backup directory if needed mkdir -p "$BACKUP_DIR" # Backup current hosts file cp "$HOSTS_FILE" "$BACKUP_DIR/hosts.$(date +%Y%m%d)" # Download latest AI domains in hosts format curl -sf -H "Authorization: Bearer $API_KEY" \ "https://api.aitoolsblocklist.com/v1/feed?format=hosts" \ -o /tmp/ai-hosts-block.txt if [ $? -ne 0 ]; then echo "[ERROR] Failed to download AI blocklist" | logger -t ai-hosts exit 1 fi # Remove old AI blocklist entries from hosts file sed -i "/$MARKER_START/,/$MARKER_END/d" "$HOSTS_FILE" # Append new entries with markers { echo "$MARKER_START" echo "# Updated: $(date -u +%Y-%m-%dT%H:%M:%SZ)" echo "# Source: aitoolsblocklist.com" cat /tmp/ai-hosts-block.txt echo "$MARKER_END" } >> "$HOSTS_FILE" # Flush DNS cache (macOS) if [ "$(uname)" = "Darwin" ]; then dscacheutil -flushcache killall -HUP mDNSResponder 2>/dev/null fi COUNT=$(grep -c "^0.0.0.0" /tmp/ai-hosts-block.txt) echo "[OK] AI hosts blocklist updated: $COUNT domains" | logger -t ai-hosts rm /tmp/ai-hosts-block.txt
# === AI TOOLS BLOCKLIST START === and END
This PowerShell script performs the same function: download, format, replace, and flush. Run it via Windows Task Scheduler as SYSTEM for write access without user interaction.
# Update-AIHostsBlocklist.ps1 # Run as Scheduled Task: Daily at 04:00, Run as SYSTEM $ApiKey = "YOUR_API_KEY" $HostsPath = "C:\Windows\System32\drivers\etc\hosts" $BackupDir = "C:\ProgramData\AIBlocklist\backups" $MarkerStart = "# === AI TOOLS BLOCKLIST START ===" $MarkerEnd = "# === AI TOOLS BLOCKLIST END ===" # Create backup New-Item -ItemType Directory -Force -Path $BackupDir | Out-Null Copy-Item $HostsPath "$BackupDir\hosts_$(Get-Date -Format yyyyMMdd).bak" # Download latest AI domains $Headers = @{ Authorization = "Bearer $ApiKey" } try { $Response = Invoke-RestMethod ` -Uri "https://api.aitoolsblocklist.com/v1/feed?format=hosts" ` -Headers $Headers } catch { Write-EventLog -LogName Application -Source "AIBlocklist" ` -EventId 1001 -Message "Failed to download AI blocklist: $_" exit 1 } # Read current hosts file, strip old AI entries $Lines = Get-Content $HostsPath $InBlock = $false $Clean = $Lines | Where-Object { if ($_ -eq $MarkerStart) { $InBlock = $true; return $false } if ($_ -eq $MarkerEnd) { $InBlock = $false; return $false } -not $InBlock } # Append new AI blocklist $NewBlock = @( $MarkerStart "# Updated: $(Get-Date -Format o)" "# Source: aitoolsblocklist.com" $Response $MarkerEnd ) $Clean + $NewBlock | Set-Content -Path $HostsPath -Encoding ASCII # Flush DNS cache ipconfig /flushdns | Out-Null $Count = ($Response -split "`n" | Where-Object { $_ -match "^0\.0\.0\.0" }).Count Write-EventLog -LogName Application -Source "AIBlocklist" ` -EventId 1000 -Message "AI hosts blocklist updated: $Count domains"
Open an elevated PowerShell prompt and run the following command:
Register-ScheduledTask -TaskName "AI Hosts Blocklist Update" -Trigger (New-ScheduledTaskTrigger -Daily -At 4am) -Action (New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-ExecutionPolicy Bypass -File C:\Scripts\Update-AIHostsBlocklist.ps1") -User "SYSTEM" -RunLevel Highest
Updating hosts files individually is impractical at scale. Group Policy (Windows) and MDM (macOS) push updates to every managed machine automatically.
\\dc01\netlogon\scripts\)
/etc/hosts access
A technically savvy employee with admin access can edit the hosts file to remove entries. Counter this with platform-specific controls:
| Platform | Tamper Prevention Method |
|---|---|
| Windows | Restrict local admin rights or use AppLocker / Windows Defender Application Control to prevent hosts file editing |
| macOS | Deploy hosts file as a managed MDM configuration profile that users cannot modify |
| Linux | Set immutable attribute with chattr +i /etc/hosts after each update — prevents modification even by root until removed |
Both methods prevent endpoints from resolving AI-tool domains. They operate at different layers with different trade-offs — and the best answer is often to use both.
*.openai.com with a single rule instead of listing every subdomain individuallyDoes a hosts file with 16,024+ entries slow down DNS lookups? In practice, the impact is minimal on modern systems.
| OS | Resolver | Caching | Lookup Speed |
|---|---|---|---|
| Linux | glibc getaddrinfo() — linear parse on each lookup |
nscd or systemd-resolved caches lookups |
<2 ms uncached for 40K entries |
| Windows | DNS Client service (Dnscache) — caches in memory | Detects file changes, reloads cache automatically | <1 ms cached; 200–400 ms initial load |
| macOS | mDNSResponder — reads at startup and on change |
Caches entries in memory after first read | <1 ms cached; handles 16,024+ entries well |
Linux Uncached Lookup
Linear parse of 40K entries on modern CPU
Windows Cached Lookup
DNS Client service caches in memory
File Size on Disk
16,024+ entries, ~50 bytes/line
?format=hosts&category=text-language,code-development
Download the free sample to test on your machines today. Or tell us about your environment and we will send a ready-to-deploy hosts file within 24 hours.
Tell us about your environment — number of machines, operating systems, update frequency, and any categories you want to exclude. We will provide a ready-to-deploy hosts file within 24 hours.