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

    Using DNS in PFSense to split traffic based on host request

    Scheduled Pinned Locked Moved DHCP and DNS
    6 Posts 2 Posters 3.1k 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
      shad061
      last edited by

      I have tried to research this topic but just get confused by the plethora of information available on DNS in pf. I have two web servers, each with different sites (mainly some of my projects run on IIS and some only on linux) behind a single public IP and NAT configured with pfsense. I have no problems with simple port forwards in pf but what I would like to try and figure out is how to host 2 different web servers on the same IP and split traffic with pf based on a list of hosts on each server. Please don't respond with "run one on a different port". Can anyone give me heads up on where to start with this?

      1 Reply Last reply Reply Quote 0
      • marcellocM
        marcelloc
        last edited by

        You need a reverse proxy for that.

        Install varnish package. It's really fast and will also reduce yours servers load.

        Treinamentos de Elite: http://sys-squad.com

        Help a community developer! ;D

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

          Thank you. I'm trying to figure that out now but wow. Varnish looks more complicated than DNS. All the documentation on it refers to config files no gui. I want point click! LOL

          Well I am going to keep trying this but if anyone has any easier ways I'l love to hear them.

          Thank you.

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

            Can port under "backends" be a list or range? i.e. "43,80,1000" or "40-50"

            1 Reply Last reply Reply Quote 0
            • marcellocM
              marcelloc
              last edited by

              I don't think so.

              you can publish only port 80 from varnish and then forward based on hostname or url to local servers on  any port.

              varnish does not work with ssl yet.

              If you need ssl balance, you can use pfsense load balance or haproxy package. Both balance based on ip not in hostname

              Treinamentos de Elite: http://sys-squad.com

              Help a community developer! ;D

              1 Reply Last reply Reply Quote 0
              • marcellocM
                marcelloc
                last edited by

                To do not get off topic, you can ask for varnish help on this thread

                http://forum.pfsense.org/index.php/topic,38271.0.html

                Treinamentos de Elite: http://sys-squad.com

                Help a community developer! ;D

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