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

Redirect (forward?) from a dynamic DNS hostname to an internal server port

Scheduled Pinned Locked Moved DHCP and DNS
6 Posts 2 Posters 886 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.
  • G
    gordonpn
    last edited by Jan 4, 2020, 6:02 PM

    Re: Dynamic DNS & Namecheap

    Hello,

    I am still learning the terminology in this field. I found the topic linked above through Google search. I am basically trying to achieve the same as user mgodinez was trying.

    I set up a Dynamic DNS Client under the hostname of hello.mydomain.com for example and now I want this hostname to link me to an internal IP with port such as 192.168.2.45:8008. I am lost in the myriad of settings that pfSense offers after this step.

    Would somebody be kind enough to point me in the right direction please?

    On my old ASUS router, I had simply forwarded the port 80 of the router to the internal IP:Port of choice. That may or may not be good practice, I'm not sure. I'd like to learn.

    Thank you.

    1 Reply Last reply Reply Quote 0
    • N
      netblues
      last edited by Jan 4, 2020, 6:17 PM

      dynamic dns and port forwarding are two unrelated things.
      Dynamic dns is a means of automatically assigning a dns name to an often changing ip, in most cases assigned by an isp.
      port forwarding is enabling a packet hitting a specific port (typically on a wan interface) to be forwarded and nated to an internal address. port.
      In pfsense,port forward is defined on firewall, nat port-forward and is the same idea as on an asus router.
      Having said that, pf, as a firewall needs also rules on specific wan interface for port forward to work.
      And one last thing, when creating rules, target ip is NOT the wan ip, but the ip traffic is getting forwarded to, typically on a private ip range.

      Hope this helps :)

      1 Reply Last reply Reply Quote 0
      • G
        gordonpn
        last edited by gordonpn Jan 4, 2020, 7:45 PM Jan 4, 2020, 7:21 PM

        EDIT: Some progress! I think the DNS took effect, but the error is "ERR_CONNECTION_REFUSED" now when I try to load the webpage.

        Here is what I tried, but I don't think it is working.

        Could you tell me if you see something wrong?

        1. I've made a new firewall rule as follows:
          Screen Shot 2020-01-04 at 2.13.38 PM.png

        2. I went in my Namecheap domain name provider to add the two first records, the two bottom ones were already there.
          Screen Shot 2020-01-04 at 2.14.43 PM.png

        3. I set up my Dynamic DNS Client in pfSense as follows:
          Screen Shot 2020-01-04 at 2.17.06 PM.png

        4. Using HAProxy, I set up a backend to point at the internal server address:port and a frontend that points to that backend if the hostname matches "hello.mydomain.com", pretendng that mydomain.com is the one that I leased.

        1 Reply Last reply Reply Quote 0
        • N
          netblues
          last edited by Jan 5, 2020, 6:34 AM

          You are doing http redirects at the hosting provider web server. This will only work for http/s but nothing else.
          You dont really need this much complexity. A simple cname pointing to your dynamic ip host name is all that is needed.
          As for pf, messing with haproxy adds much more complexity and again is focused on web traffic, and is certainly not a replacement for a simple port forward.

          G 1 Reply Last reply Jan 5, 2020, 6:42 AM Reply Quote 0
          • G
            gordonpn @netblues
            last edited by Jan 5, 2020, 6:42 AM

            @netblues

            My end goal is to have a few subdomains linking to personal web servers.

            For what it's worth, I got it working with Squid Reverse Proxy Server, but only internally (as in while I am connected to the local network).

            Do you know how I could make them public facing, so I could access them from anywhere?

            You dont really need this much complexity. A simple cname pointing to your dynamic ip host name is all that is needed.

            If I go this route, could this work with multiple web servers running on different ports from the same address 192.168.1.25, for example?

            N 1 Reply Last reply Jan 5, 2020, 6:56 AM Reply Quote 0
            • N
              netblues @gordonpn
              last edited by netblues Jan 5, 2020, 6:57 AM Jan 5, 2020, 6:56 AM

              @gordonpn
              You can have as many cnames pointing to the same dynamic ip as you like.
              Your internal web server can handle thousands of different sites with domain virtual hosting negotiation (a http 1.1 feature) . You don't need anything else, and certainly not many web servers running on different ports.

              1 Reply Last reply Reply Quote 0
              3 out of 6
              • First post
                3/6
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                This community forum collects and processes your personal information.
                consent.not_received