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

    Redirect malicious domain to another domain or website

    pfBlockerNG
    3
    7
    533
    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.
    • W
      walidbz
      last edited by

      Is it possible to redirect client attempting to reach a malicious domain, to another domain or website ?
      for example : when client wants to connect to malicious domain which is blocked by DNSBL, then i want to redirect him to www.google.com for example .

      P 1 Reply Last reply Reply Quote 0
      • P
        Patch @walidbz
        last edited by

        @walidbz not easily as that’s what site certificates prevent. To do so you need your clients to have an extra certificate to allow you to do a man in the middle interception.

        W 1 Reply Last reply Reply Quote 1
        • W
          walidbz @Patch
          last edited by

          @Patch thank you for your reply.
          So, is it the same problem if i want to redirect him to an internal webserver in my network ?
          NB: the website is without certificate (http)

          P S 2 Replies Last reply Reply Quote 0
          • P
            Patch @walidbz
            last edited by

            @walidbz said in Redirect malicious domain to another domain or website:

            @Patch thank you for your reply.
            So, is it the same problem if i want to redirect him to an internal webserver in my network ?
            NB: the website is without certificate (http)

            Yes
            You can easily make the site unreadable but not substitute another site without significantly more effort.

            W 1 Reply Last reply Reply Quote 1
            • W
              walidbz @Patch
              last edited by

              @Patch so do you have a solution please ?

              1 Reply Last reply Reply Quote 0
              • S
                SteveITS Galactic Empire @walidbz
                last edited by

                @walidbz said in Redirect malicious domain to another domain or website:

                redirect him to an internal webserver in my network

                Use a plain HTTP redirect. Create a host override in DNS to resolve the domain (and its www) to your internal server's IP. On your web server create a site for that domain, and have that site redirect to whatever URL you want.

                Note when blocking via DNS you may need to block DNS over HTTP or DNS over TLS so browsers don't bypass your DNS. There is a PDF writeup for pfSense at https://github.com/jpgpi250/piholemanual. It is rather detailed but is complete.

                Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                Upvote 👍 helpful posts!

                W 1 Reply Last reply Reply Quote 1
                • W
                  walidbz @SteveITS
                  last edited by

                  @SteveITS thank you for your help.

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