Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How to block web site, simple step by step

    Scheduled Pinned Locked Moved pfBlockerNG
    20 Posts 3 Posters 2.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • the otherT
      the other @andrzejls
      last edited by

      @andrzejls hey there,
      if I am not mistaken, the last post by @johnpoz is related to proxy config whereas his first post related to pfblocker (sorry if I misunderstood).

      I would also rather choose blocking via pfblocker and dns-blocklists or individual entries. It is not as memory consuming and (imho) much easier to configure and not as hungry on hardware ressources...as said jm2c.

      Also, there are other (already usable) blocklists: for dns searches (dnsbl), for IPv4 and IPv6 in case you have open ports running and do not want all those crappy IPs knocking and trying to enter.

      I used to run pihole on a raspi, then tried out pfblockerng (pfsense ce here) and decided to switch over to pfblocker. It works fine here, is nicely integrated with pfsense (as mentioned: aliases work fine) and I can save some energy, not using another device for dns blocking.
      BTW: big thanx to the developer of pfblockerng and some karma points to your account...
      :)

      the other

      pure amateur home user, no business or professional background
      please excuse poor english skills and typpoz :)

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator @andrzejls
        last edited by johnpoz

        @andrzejls said in How to block web site, simple step by step:

        so I have no idea where "custom options" would be

        That is just in the unbound settings..

        I do not use proxy, I do not use pfblocker to block outbound traffic, I do not use it to create rules... I only use it to create native aliases that contain IPs of stuff I want to block inbound to my pfsense on ports I have open.

        You can for sure block domains in pfblocker - I just do not use it in that fashion, and so can not just show you a screen shot of how without major changes to my setup..

        It seems like your goal is to block cnn.com - and really don't care how you do it. I am showing you the easy way to do it, and how I would do it. Since most anyone using pfsense would be using it as their dns for their network..

        Its a simple entry in custom options of unbound.. Now if you have hundreds of domains your trying to block, or want to auto load in lists of bad domain names, etc. Then this would not be the way to skin that cat.

        But for your question how to block cnn.com - this would be how I would skin that cat, 10 seconds total time to do it.. Now nobody using pfsense (unbound) for dns on your network is going to resolve cnn.com or anythingelse.whatever.other.cnn.com etc..

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        andrzejlsA 1 Reply Last reply Reply Quote 0
        • andrzejlsA
          andrzejls @johnpoz
          last edited by

          @johnpoz I thank you for your help, but please understand I am noob in setting individual sites blocking in pfsense. I do not know where, in pfsense, to go to do what you are showing me. My pf sense is setup for dns on my network.

          johnpozJ 1 Reply Last reply Reply Quote 0
          • johnpozJ
            johnpoz LAYER 8 Global Moderator @andrzejls
            last edited by

            @andrzejls in the resolver (unbound)

            unbound.jpg

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

            andrzejlsA 1 Reply Last reply Reply Quote 0
            • andrzejlsA
              andrzejls @johnpoz
              last edited by

              @johnpoz Great, thanks. Now I know where to go, but still I can acces that web site. Should I reboot pfsense, clear Brave cache?.

              johnpozJ 1 Reply Last reply Reply Quote 0
              • johnpozJ
                johnpoz LAYER 8 Global Moderator @andrzejls
                last edited by

                @andrzejls and again - clients have their own cache.. Clear the clients dns cache, on windows that can be done with ipconfig /flushdns, also browsers run their own cache as well.

                No you would not need to reboot pfsense.

                Do a query for cnn.com - do you get what IP you put in 0.0.0.0 or 127.0.0.1?

                Keep in mind also if your actually using the proxy - the proxy is going there for your client and the client is not doing any dns for cnn.com..

                An intelligent man is sometimes forced to be drunk to spend time with his fools
                If you get confused: Listen to the Music Play
                Please don't Chat/PM me for help, unless mod related
                SG-4860 24.11 | Lab VMs 2.8, 24.11

                andrzejlsA 1 Reply Last reply Reply Quote 0
                • andrzejlsA
                  andrzejls @johnpoz
                  last edited by

                  @johnpoz I still can access web page. Maybe it is me but It seams strange that pfSense being such a powerfull firewall that is is so difficult to block individual web pages.

                  johnpozJ 1 Reply Last reply Reply Quote 0
                  • johnpozJ
                    johnpoz LAYER 8 Global Moderator @andrzejls
                    last edited by

                    @andrzejls said in How to block web site, simple step by step:

                    is so difficult to block individual web pages.

                    It is not difficult - its childs play really with the tools that pfsense provides. But not understanding the tools and how they work, then sure it difficult trying to use a tool you do not understand.

                    You could block via pfblocker with couple different methods, you could sure block with proxy, or you could just block with simple dns. You could also block via just firewall rules to what IPs you want to block, etc. And you could even just have pfsense resolve some fqdn, and use that IP(s) in a firewall rule.

                    You could give a cave man a tricoder from star trek - do you think he would be able to use it?

                    I gave you the simpliest way I can think of to block a domain that has IPs that change, and has multiple IPs.. You just need to use a client that uses pfsense for its dns, and isn't using doh in its browser, etc.. Or using a proxy..

                    First step - if you setup your domain like I showed in unbound - do a query from your client using nslookup, dig, host - your fav dns tool.. Does it return the blocking IP you put in? If not then your client isn't using pfsense for dns, or you didn't setup unbound correctly to return that IP for that fqdn..

                    An intelligent man is sometimes forced to be drunk to spend time with his fools
                    If you get confused: Listen to the Music Play
                    Please don't Chat/PM me for help, unless mod related
                    SG-4860 24.11 | Lab VMs 2.8, 24.11

                    andrzejlsA 1 Reply Last reply Reply Quote 0
                    • andrzejlsA
                      andrzejls @johnpoz
                      last edited by

                      @johnpoz said in How to block web site, simple step by step:

                      @andrzejls said in How to block web site, simple step by step:

                      is so difficult to block individual web pages.

                      It is not difficult - its childs play really with the tools that pfsense provides. But not understanding the tools and how they work, then sure it difficult trying to use a tool you do not understand.

                      You are 100% correct. That is the reason I ask. I removed "squid" so I only run pfblockerNG and "snort"
                      Here are my "custom options:
                      Screenshot from 2023-05-12 13-36-04.png

                      johnpozJ 1 Reply Last reply Reply Quote 0
                      • johnpozJ
                        johnpoz LAYER 8 Global Moderator @andrzejls
                        last edited by johnpoz

                        @andrzejls ok that looks ok even if your loading the pfblocker.conf

                        So do a query to unbound on pfsense.. Does it return 0.0.0.0 like my examples.

                        If not - then your client is not using pfsense for dns and can still get to cnn.com, maybe your browser is using doh (dns over http) many browsers love to do that on their own, etc.

                        Or your local browser or os has the IP of cnn.com still cached.

                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                        If you get confused: Listen to the Music Play
                        Please don't Chat/PM me for help, unless mod related
                        SG-4860 24.11 | Lab VMs 2.8, 24.11

                        andrzejlsA 1 Reply Last reply Reply Quote 0
                        • andrzejlsA
                          andrzejls @johnpoz
                          last edited by

                          @johnpoz You were right on the money. My Linux laptop Brave browser was set to use 1.1.1.1 DNS. Once I changed that to pfSense IP it works. Thanks for your assistance, patience and understanding my lack of knowledge on this subject.

                          johnpozJ 1 Reply Last reply Reply Quote 0
                          • johnpozJ
                            johnpoz LAYER 8 Global Moderator @andrzejls
                            last edited by

                            @andrzejls glad you got it sorted.. btw your not really blocking cnn.com are you ;) hehe I take it that is just some test you doing on how to block a site..

                            An intelligent man is sometimes forced to be drunk to spend time with his fools
                            If you get confused: Listen to the Music Play
                            Please don't Chat/PM me for help, unless mod related
                            SG-4860 24.11 | Lab VMs 2.8, 24.11

                            andrzejlsA 1 Reply Last reply Reply Quote 0
                            • andrzejlsA
                              andrzejls @johnpoz
                              last edited by

                              @johnpoz Of course, it is just a "test" :) hahaha. I am also testing cbs,nbc, and other main stream media.

                              1 Reply Last reply Reply Quote 1
                              • First post
                                Last post
                              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.