Please help me write firewall rule

Hello, everyone.

I have a situation - mail server and a web server in 2 different VMs behind a pFsense firewall in another VM. Mail and web servers have only private IP addresses in 192.168.2.0/24 subnet.

My problem is that when webserver tries to connect to the mail server by FQDN it can’t - mail server is not responding unless I add a string to the hosts file on the webserver 192.168.2.105 mail.mydomain.com. Everything works fine then.

I have a port forward set up with associated firewall rule - Source ‘Any with all mail-related ports’, destination ‘IP address of my mail server on all mail-related ports’. If the source is ‘Any’ then it perhaps should cover LAN address and/or LAN net? I tried adding a separate firewall rule specifying LAN address and LANnet but nothing worked so far.

How should this scenario be handled? From LAN host to another LAN host by FQDN through firewall.

Thanks in advance

Make sure you have NAT reflection configured
https://docs.netgate.com/pfsense/en/latest/nat/reflection.html

I also have a video on port forwarding here:

1 Like

Super helpful. Thank you. I should have asked earlier :slight_smile:
So much time and thought effort wasted trying to figure this out. Never accepted to do it through hosts files, though.