Reaching an Internal Web Server using External DNS
-
We have a client that has their own web server internally to their network. It's for staff use but they also have a domain tied to it to make it easy for them to connect to. On the old ASUS router everything worked fine. With pfSense, if we go to their address www.address.com remotely it connects in as we have the appropriate ports forwarded. If we go to www.address.com internally we get a DNS rebind attack page. We disabled the DNS rebind setting but now nothing comes up when we go there (it's just a 404). I'm guessing I need some sort of Firewall rule to allow it to go out and back in. If we go directly to the internal IP it works fine. Some of the users aren't grasping the internal link vs external link idea so I want to simplify it and just let everyone go to the external link. What type of rule do I need to set up?
I have attached the rules I thought I would need. These are on the Firewall/NAT/Port Forward screen. I feel like maybe I need something somewhere else. Just not sure how to get it to loop back in and why it worked so easily on the old "dumb" router.
Thanks for any help you can give!
-
If you need to use an external DNS you have to activate NAT reflection. You can do this separately in each NAT forward rule or globally in System > Advanced > Firewall & NAT.
In your case you will get best result with "NAT reflection + proxy". -
Thanks! I knew there had to be something simple like that but didn't realize it was in the Rule. That was it.
-
Is there any reason you're not using the built in pfSense DNS? You can easily configure hosts in it, with the local address. You can even enable this in the DHCP server. This is what I do for IPv4.
-
"we get a DNS rebind attack page."
So your public dns is returning a rfc1918 address? That is a borked config right there.
Why not just setup a host override for your internal uses so that www.address.com resolve to its rfc1918 address for them. Then public have that resolve to your public IP and setup your forwards so it can be accessed externally if you need/want that.
-
"we get a DNS rebind attack page."
So your public dns is returning a rfc1918 address? That is a borked config right there.
Let's say you have a domain called www.contoso.com whose DNS points to your public IP. You then have port 80 on the router forwarded to something on your network (web server, Security System, etc). If you are on the same network as the web server and try to go to www.contoso.com you will get a rebind attack. There's nothing crazy about the config.
Why not just setup a host override for your internal uses so that www.address.com resolve to its rfc1918 address for them. Then public have that resolve to your public IP and setup your forwards so it can be accessed externally if you need/want that.
For some reason pointing directly to an internal IP on the network doesn't work properly. The web server has 2 NICs and apparently both are needed for it to work properly. Why port forwarding in the router to one of the IPs works, however, is beyond me. I didn't set up the web server and I'm not about to say I understand why it does what it does.
Is there any reason you're not using the built in pfSense DNS? You can easily configure hosts in it, with the local address. You can even enable this in the DHCP server. This is what I do for IPv4.
They have a domain and so use the DC's DNS for Active Directory resolution. The DC does look to the router for DNS as its primary lookup source.
-
Nat reflection is not a rebind issue. But it is an issue in its own right, if you ask me its an abomination ;)
Why do you have forwards on your LAN interface going to your wan address? And why are you forwarding udp, are you using QUIC?
Good luck..