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

    How to block a top level domain pfsense

    Scheduled Pinned Locked Moved pfBlockerNG
    10 Posts 7 Posters 9.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.
    • S
      skillsboy
      last edited by

      Hi,

      is there anyway to block a top level domain ?

      Im trying to block all websites from a tld for example ".com".

      If there is how ?

      Thanks.

      1 Reply Last reply Reply Quote 0
      • M
        marvosa
        last edited by

        For basic filtering needs, you can leverage the squid/squidGuard packages, but for anything more advanced you'll need to implement a UTM.

        1 Reply Last reply Reply Quote 0
        • S
          skillsboy
          last edited by

          I used the dns override in the dns resolver service, it seems to work if the client does not configure a manual dns.

          Thanks anyways.

          1 Reply Last reply Reply Quote 0
          • P
            phil.davis
            last edited by

            And you can put in block rules to port 53 anywhere that is not the pfSense interface address and/or redirect all traffic heading to some DNS port 53 to pfSense. Then people "cannot" use an outside DNS server.

            (but if they do stuff like establish a VPN from their client to their favorite VPN provider, then their DNS will be tunneled in that and so the pfSense rules will not see it to block or redirect it)

            and if they fill their local hosts file on the client with the names and IP resolutions of all their favorite "naughty" sites then they effectively have their own DNS "cache" (which will admittedly go gradually stale - but most big web sites keep a permanent IP address). So their browser will resolve site locally and then happily go of to them using the IP address.

            So there are ways for clients to get around all this stuff.

            As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
            If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

            1 Reply Last reply Reply Quote 0
            • S
              skillsboy
              last edited by

              That's a good idea blocking the dns traffic !

              Yeah there are always ways for clientes to go around but i'm not worried, because it's for a school assignment.

              Thank you for the ideas.

              1 Reply Last reply Reply Quote 0
              • F
                f34rinc
                last edited by

                The package pfBlockerNG will do TLD blocking using DNSBL.

                1 Reply Last reply Reply Quote 0
                • S
                  skillsboy
                  last edited by

                  I have tried that pachage, but for some reason it didn't work for me.

                  If you know a tutorial on how to configure it that would be great !

                  Thanks.

                  1 Reply Last reply Reply Quote 0
                  • A
                    anajames
                    last edited by

                    The package does not work for me either. Any guide would be appreciated.

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

                      If you want help with pfblocker, you should really post your ?'s in the package section, pointing out what version of pfsense your using and what version of the package your using.

                      That being said you sure do not need pfblocker to stop simple access to tld..  Just put in a domain override for your tld and your done - just point the domain override to something that can will not return anything loopback, 0.0.0.0 etc..

                      Took all of 2 seconds to do..

                      Clearly this would only work if the devices are actually pointing to pfsense for dns.. If they are using something else - then no it wouldn't work, so block them from using something else, or redirect their dns tcp/udp 53 traffic to pfsense and there you go works.

                      blocktld.png
                      blocktld.png_thumb

                      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

                      1 Reply Last reply Reply Quote 0
                      • BBcan177B
                        BBcan177 Moderator
                        last edited by

                        @skillsboy:

                        I have tried that pachage, but for some reason it didn't work for me.

                        @anajames:

                        The package does not work for me either. Any guide would be appreciated.

                        To implement this in pfBlockerNG DNSBL, just follow these basic instructions:
                            https://forum.pfsense.org/index.php?topic=102470.msg572943#msg572943

                        Then enable the TLD option.
                        Enter all of the TLDs that you would like to block ie "ru" "cn" "pw" "top" etc… into the TLD Blacklist customlist. You can click on the blue infoblock icons for further details…

                        The benefit of using the TLD feature of the pfBlockerNG package is that blocking a TLD will also remove all other blocklist references to domains that have these blocked TLDs. So this will reduce the overall size of the DNSBL database...

                        You can also leverage the TLD Whitelist option, to allow a specific Domain while still blocking all other domains in a TLD.

                        Here is a list of the worst TLDs as reference:

                        https://www.spamhaus.org/statistics/tlds/
                            http://toolbar.netcraft.com/stats/tlds

                        Hope that helps!

                        "Experience is something you don't get until just after you need it."

                        Website: http://pfBlockerNG.com
                        Twitter: @BBcan177  #pfBlockerNG
                        Reddit: https://www.reddit.com/r/pfBlockerNG/new/

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