Blocking Web Sites | pfSense Documentation (2024)

There are several options for blocking websites with pfSense® software,some of which are described on this article. This is not an exact science, butthese solutions typically function well enough for a majority of use cases.

See also

The pfBlockerNG package (pfBlocker-NG Package) offers mechanisms whichcan be useful in this area, such as DNSBL, geographic IP address blocking,and automation of AS lookups.

Using DNS

If the built in DNS Resolver or Forwarder are active an override can be enteredthere to resolve the unwanted website to an invalid IP address such as127.0.0.1.

Warning

Do not use DNS override functionality as the only means of blocking access tosites.

Blocking via DNS requires that local clients utilize the firewall as theironly DNS source. See Redirecting Client DNS Requests andBlocking External Client DNS Queries for suggestions on ensuring clients get their DNSresponses from the firewall. It will stop non-technical users, but it is easyto circumvent for those with more technical aptitude.

With the DNS Resolver, additional methods are possible via custom options.

This first example will prevent any host under the given zone from beingresolved by clients:

server:local-zone: "movie.edu" static

When the firewall enforces DNS resolution in this way, the firewall must alsoforce clients to resolve DNS using the firewall. Otherwise, clients could bypassthe restrictions by using alternate DNS servers. See Redirecting Client DNS Requests fordetails.

This can be limited in scope using custom views. This example is similar to theabove, but only blocks access for 10.6.0.100:

server:access-control-view: 10.6.0.100/32 blocksitesview:name: "blocksites"local-zone: "movie.edu" static

Using Firewall Rules

If a website rarely changes IP addresses, then it can be blocked by an alias.Create an alias containing its IP addresses and then use this alias in firewallrules.

Warning

This is not a feasible solution for sites that return low TTLs and spread theload across many servers and/or datacenters, such as Google and similar largesites. Most small to mid sized websites can be effectively blocked using thismethod as they rarely change IP addresses.

A hostname can also be inside a network alias. The firewall will resolve thehostname periodically and update the alias as needed. This is more effectivethan manually looking up the IP addresses, but will still fall short if the sitereturns DNS records in a way that changes rapidly or randomizes results from apool of servers on each query, which is common for large sites.

Another option is finding all of the IP subnet allocations for a site. Createan alias with those networks and block traffic to those destinations. This isespecially useful with sites such as Facebook that spread large amounts of IPspace, but are constrained within a few net blocks. Using regional registrysites such as ARIN can help track down those networks. For example, all of thenetworks used by Facebook in the region covered by ARIN can be found athttp://whois.arin.net/rest/org/THEFA-3.html under “Related Networks”.Companies may have other addresses in different regions, so check other regionalsites as well, such as RIPE, APNIC, etc.

As an alternative to looking up the IP blocks manually, locate the BGPAutonomous System (AS) number for the target company by doing a whois lookupon one of their IP addresses. For example, the AS number for Facebook isAS32934 and the following command will locate all of their allocations:

# whois -h whois.radb.net -- '-i origin AS32934' | awk '/^route:/ {print $2;}' | sort | uniq

Copy the results of that command into a new alias and it will cover all of theircurrently allocated networks. Check the results periodically for updates.

Using a Proxy

In modern environments a client proxy is not effective. HTTPS can sometimes befiltered via peek/splice to inspect SNI and similar aspects of connections, buteven that fails with modern security practices like encrypted SNI. Using proxiesfor these tasks is no longer a recommended practice.

Prevent Bypassing Restrictions

With any of the above methods, there are many ways to get around the definedblocks. The easiest and likely most prevalent is using any number of proxywebsites. Finding and blocking all of these individually and keeping the list upto date is impossible. The best way to ensure these sites are not accessible isusing an external proxy or content filtering capable of blocking by category.

To further maintain control, use a restrictive egress ruleset and only allowtraffic out to specific services and/or hosts. For example, only allow DNSaccess to the firewall or the DNS servers specifically used for LAN clients(Redirecting Client DNS Requests). Also, if a proxy is in use on the network, make sure todisallow direct access to HTTP and HTTPS through the firewall and only allowtraffic to and/or from the proxy server.

Blocking Web Sites | pfSense Documentation (2024)
Top Articles
Cake Worries? Figuring Out size for a Wedding Cake for 100 guests. - Cute Cakes Bakery & Café
IPFS Companion | IPFS Docs
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
How To Cut Eelgrass Grounded
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Dmv In Anoka
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Umn Biology
Obituaries, 2001 | El Paso County, TXGenWeb
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Colin Donnell Lpsg
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
San Pedro Sula To Miami Google Flights
Selly Medaline
Latest Posts
Article information

Author: Greg Kuvalis

Last Updated:

Views: 6250

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Greg Kuvalis

Birthday: 1996-12-20

Address: 53157 Trantow Inlet, Townemouth, FL 92564-0267

Phone: +68218650356656

Job: IT Representative

Hobby: Knitting, Amateur radio, Skiing, Running, Mountain biking, Slacklining, Electronics

Introduction: My name is Greg Kuvalis, I am a witty, spotless, beautiful, charming, delightful, thankful, beautiful person who loves writing and wants to share my knowledge and understanding with you.