pfSense Support Subscription

Author Topic: Using DNS in PFSense to split traffic based on host request  (Read 1949 times)

0 Members and 1 Guest are viewing this topic.

Offline shad061

  • Newbie
  • *
  • Posts: 5
    • View Profile
Using DNS in PFSense to split traffic based on host request
« on: January 09, 2012, 09:33:33 pm »
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?

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 9961
    • View Profile
Re: Using DNS in PFSense to split traffic based on host request
« Reply #1 on: January 09, 2012, 09:40:14 pm »
You need a reverse proxy for that.

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

Offline shad061

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Using DNS in PFSense to split traffic based on host request
« Reply #2 on: January 09, 2012, 10:01:00 pm »
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.

Offline shad061

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Using DNS in PFSense to split traffic based on host request
« Reply #3 on: January 09, 2012, 10:04:37 pm »
Can port under "backends" be a list or range? i.e. "43,80,1000" or "40-50"

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 9961
    • View Profile
Re: Using DNS in PFSense to split traffic based on host request
« Reply #4 on: January 09, 2012, 10:12:14 pm »
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

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 9961
    • View Profile
Re: Using DNS in PFSense to split traffic based on host request
« Reply #5 on: January 09, 2012, 10:14:35 pm »
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