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

How to redirect custom urls to some local IPs with pfSense

Scheduled Pinned Locked Moved DHCP and DNS
7 Posts 3 Posters 29.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.
  • C
    cobalt2760
    last edited by Apr 15, 2014, 2:53 PM

    Hi there,

    I opened up a ServerFault question here http://serverfault.com/questions/589147/how-to-redirect-custom-urls-to-some-local-ips-with-pfsense when I realized there could be some useful help here :)

    Basically, I'd like to setup a wifi local network and map a certain url to a server on this network. Here is the image of the desired config:

    I've searched again and again in pfSense config (DNS, Firewall, NAT..) but in vain.

    How could I achieve that?

    Thanks a lot

    1 Reply Last reply Reply Quote 0
    • P
      phil.davis
      last edited by Apr 15, 2014, 3:44 PM

      You can add a Host Override in DNS Forwarder GUI. That will map the host.domain to the IP address you want. Then the rest of the URL is a reference to some page on that server.

      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
      • C
        cobalt2760
        last edited by Apr 15, 2014, 4:30 PM

        Hi Phil,

        That what I thought, I created an entry in DNS Forwarder > Host Overrides

        What I entered:

        | host      |  domain      | IP                |
        –---------------------------------------------
        | myurl    |  myurl.ext  | 172.16.1.42 |

        But then when on my machine I try to ping myurl.ext it fails, while pinging directly the IP works.

        Maybe there is something else to configure with DNS?

        Thanks for your help

        1 Reply Last reply Reply Quote 0
        • P
          phil.davis
          last edited by Apr 15, 2014, 4:46 PM

          The entry you made will be for myurl.myurl.ext
          Put myurl in host, and just "ext" in domain.

          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
          • C
            cobalt2760
            last edited by Apr 16, 2014, 12:22 PM

            Awesome, that works!! But that was not really clear, below the "domain" field there is a direction "eg: example.com".. Quite confusing.

            Second and LAST question: it works if explicitly on my machine I set up that DNS address to use is the router IP (in my case, 172.16.1.1). In my case, I will have users that just connect leur iPhone to the wifi hotspot and I cannot ask them to specify a specific DNS config in their device.

            What do I have to set up on pfSense side to automatically tell the devices via DHCP that they should use the right pfSense IP as DNS resolver. Dunno if it is clear enough –'

            Thanks

            1 Reply Last reply Reply Quote 0
            • C
              cobalt2760
              last edited by Apr 16, 2014, 1:03 PM

              Hi there,

              I found in the DHCP config the way to set the right DNS server to connected devices, that work perfectly for me now!

              Alternate question: this is perfectly working on every device connected through rj45 directly to switch connected to pfSense, but not wireless, because my hotspot unifi seems to set its proper sub network and I can't access my server.. I'll try to sort that out alone :)

              Thanks for your help Phil!

              1 Reply Last reply Reply Quote 0
              • J
                johnpoz LAYER 8 Global Moderator
                last edited by Apr 16, 2014, 1:23 PM

                "below the "domain" field there is a direction "eg: example.com".. Quite confusing."

                How that is a normal domain, with a host in front of it like www. for example then the domain example and the top level domain (tld) com.  You using myurl.ext is using the myurl as host in the TLD ext which not a normal configuration.  host.mydomain.tld would be a more standard configuration.  Use of tld as your domain is not really common practice.

                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
                1 out of 7
                • First post
                  1/7
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                  This community forum collects and processes your personal information.
                  consent.not_received