How to Block Instagram with DNS Filtering

Instagram is one of the most popular social media platforms, and also one of the hardest to block without the right tools. This guide covers every method: DNS filtering, hosts file rules, and router-level blocking.

Learn About Pricing

Step 1: Block Instagram with CleanBrowsing

The fastest and most reliable way to block Instagram is to use CleanBrowsing's DNS filtering service. Instagram is part of the Social Media category in the CleanBrowsing dashboard. When you enable the Social Media filter, all Instagram-related domains are blocked automatically across every device on your network.

To set this up, log in to your CleanBrowsing dashboard, navigate to Content Filters, and toggle Social Media to blocked. Instagram (along with Facebook, TikTok, and other platforms) will be blocked immediately.

If you only want to block Instagram but allow other social media platforms, use the Custom Domains page instead. Add instagram.com to your blocked domain list. CleanBrowsing will automatically block all subdomains and CDN domains associated with Instagram.

When a user tries to access Instagram after it has been blocked, they will see a DNS_PROBE_FINISHED_NXDOMAIN error in their browser. The Instagram mobile app will also fail to load content, showing connection errors.

Quick Setup with Free Filters

CleanBrowsing also offers free DNS resolvers that block social media as part of broader content categories. The Family Filter (185.228.168.168 / 185.228.169.168) blocks adult content, VPNs, and proxies but does not block social media by default. For social media blocking, you need a paid plan that lets you toggle specific categories.

Step 2: Block Instagram with Hosts File

If you need to block Instagram on a single device without DNS filtering, you can edit the device's hosts file. This maps Instagram domains to 0.0.0.0, which sends all requests to a null address and prevents the browser (or app) from connecting.

Hosts File Location

  • Linux / Mac: /etc/hosts
  • Windows: C:\Windows\System32\drivers\etc\hosts

Open the hosts file with administrator or root privileges, and add the following entries. You need to list each domain individually because hosts files do not support wildcard entries.

Core Instagram Domains

Add these entries to block the primary Instagram domains:

0.0.0.0 instagram.com
0.0.0.0 www.instagram.com
0.0.0.0 m.instagram.com
0.0.0.0 l.instagram.com
0.0.0.0 i.instagram.com
0.0.0.0 about.instagram.com
0.0.0.0 help.instagram.com
0.0.0.0 api.instagram.com
0.0.0.0 graph.instagram.com
0.0.0.0 platform.instagram.com
0.0.0.0 logger.instagram.com
0.0.0.0 b.instagram.com

Instagram CDN and Content Delivery Domains

Instagram serves images, videos, stories, and reels through multiple CDN domains. Without blocking these, media content may still load even if the main site is blocked:

0.0.0.0 cdninstagram.com
0.0.0.0 www.cdninstagram.com
0.0.0.0 scontent.cdninstagram.com
0.0.0.0 scontent-iad3-1.cdninstagram.com
0.0.0.0 scontent-iad3-2.cdninstagram.com
0.0.0.0 scontent-lga3-1.cdninstagram.com
0.0.0.0 scontent-lga3-2.cdninstagram.com
0.0.0.0 scontent-atl3-1.cdninstagram.com
0.0.0.0 scontent-dfw5-1.cdninstagram.com
0.0.0.0 scontent-dfw5-2.cdninstagram.com
0.0.0.0 scontent-sjc3-1.cdninstagram.com
0.0.0.0 scontent-lax3-1.cdninstagram.com
0.0.0.0 scontent-lax3-2.cdninstagram.com
0.0.0.0 scontent-mia3-1.cdninstagram.com
0.0.0.0 scontent-ord5-1.cdninstagram.com
0.0.0.0 scontent-sea1-1.cdninstagram.com
0.0.0.0 scontent-den4-1.cdninstagram.com

Instagram Edge and API Servers

Instagram also uses edge servers and API endpoints for login, notifications, and real-time updates:

0.0.0.0 edge-mqtt.facebook.com
0.0.0.0 mqtt-mini.facebook.com
0.0.0.0 z-m-scontent.cdninstagram.com
0.0.0.0 z-p3-scontent.cdninstagram.com
0.0.0.0 z-p4-scontent.cdninstagram.com
0.0.0.0 static.cdninstagram.com

Important: Instagram is owned by Meta and shares infrastructure with Facebook. Some Instagram features rely on facebook.com subdomains (such as edge-mqtt.facebook.com for push notifications). For complete blocking, consider also blocking Facebook domains. See our Facebook domain list.

Note: CDN subdomains change frequently as Meta adds and rotates edge servers. The list above covers the most common domains, but new scontent-*.cdninstagram.com subdomains appear regularly. This is one of the main reasons DNS filtering with CleanBrowsing is more effective than manual hosts file blocking.

Step 3: Block Instagram on Your Router

Blocking Instagram at the router level ensures every device on your network is covered, including phones, tablets, smart TVs, and guest devices. There are two approaches: configuring your router to use CleanBrowsing DNS, or using your router's built-in domain blocking features.

Option A: Set CleanBrowsing DNS on Your Router

This is the recommended approach. Log in to your router's admin panel and change the DNS servers to your CleanBrowsing assigned IPs. Once configured, all DNS queries from every device on the network will pass through CleanBrowsing's filters.

  • Step 1: Log in to your router (usually at 192.168.1.1 or 192.168.0.1).
  • Step 2: Find the DNS settings (typically under WAN, Internet, or DHCP settings).
  • Step 3: Replace the existing DNS servers with your CleanBrowsing IPs.
  • Step 4: Save and reboot the router.

After the router reboots, enable the Social Media filter in your CleanBrowsing dashboard. Instagram will be blocked on all connected devices without any per-device configuration.

Option B: Use Router Domain Blocking

Some routers (especially those running OpenWrt, pfSense, or similar firmware) support domain-based blocking natively. You can add instagram.com and cdninstagram.com to the block list. However, most consumer routers do not support wildcard domain blocking, so this method is less reliable than DNS filtering.

Prevent DNS Bypass

Devices can bypass router DNS settings by using hardcoded DNS servers or encrypted DNS (DoH/DoT). To prevent this:

  • Block port 853: This prevents DNS-over-TLS (DoT) connections to external resolvers.
  • Redirect port 53: Create a firewall rule that redirects all outbound DNS (port 53) traffic to your router, regardless of destination.
  • Block known DoH providers: Block IP addresses of common DoH providers (Google DNS, Cloudflare, Quad9) at the firewall level.

For a detailed guide on preventing filter bypass, see How to Prevent Filter Bypass.

Step 4: Why DNS Filtering Is the Most Effective Approach

While hosts file edits and router-level domain blocking can work, DNS filtering through a service like CleanBrowsing is the most effective way to block Instagram for several reasons:

Automatic Domain Updates

Instagram uses hundreds of domains and subdomains that change regularly. Meta rotates CDN endpoints, adds new API servers, and shifts infrastructure across data centers. A manual block list becomes outdated within weeks. CleanBrowsing's categorization engine tracks these changes automatically, so you never need to update your block list.

Network-Wide Coverage

A hosts file only blocks Instagram on one device. DNS filtering at the router level blocks it on every device: phones, tablets, laptops, smart TVs, and IoT devices. This is particularly important for schools and businesses where hundreds of devices need consistent policy enforcement.

Granular Control

With CleanBrowsing, you can block Instagram specifically while allowing other Meta properties (like WhatsApp), or block all social media with a single toggle. You can also set different policies for different network segments, allowing staff access while blocking student access.

No Device-Level Permissions Needed

Editing hosts files requires administrator access on each device, which is impractical in environments with BYOD (bring your own device) policies. DNS filtering works transparently at the network level, requiring no access to individual devices.

Logging and Reporting

CleanBrowsing provides query logs and reports so you can see how often Instagram is being accessed (or attempted). This visibility is essential for schools, libraries, and organizations that need to demonstrate policy compliance.

CleanBrowsing makes it easy to block Instagram and other social media platforms across your entire network.

What is DNS Filtering?