2

Is there a way, in PfSense, to add aliases to the firewall, based on hostnames registered in the DNS server?

What I want to achieve is to setup a port forwarding rule, using pure NAT, to PC1.example.com, but PfSense says (same with only PC1 in the target field):

"PC1.example.com" is not a valid redirect target IP address or host alias.
Taz8du29
  • 96
  • 9

1 Answers1

0

The answer is in the error message. Use "host alias"!

  • Go to Firewall > Aliases > IP
  • Click "Add".
  • Give it a spunky name like "MY_FIRST_ALIAS"
  • Keep the Type at "Host(s)"
  • Below at the "Host(s)" section add your "PC1.example.com" in the "IP or FQDN" field.
  • "Safe"
  • "Apply Changes"
  • Go to Firewall > NAT
  • Add your NAT rule and as a "Redirect Target IP" you can now chose
    • Type: "Single host"
    • Address: "MY_FIRST_ALIAS"

That's it. Pfsense will refresh the DNS resolution of "PC1.example.com" periodically and will update the NAT and Firewall rules accordingly.

Henrik
  • 1