Configure Destination NAT with DNS Rewrite

Create a destination NAT policy rule for static translation that also rewrites the IPv4 address in a DNS response based on the original or translated destination address of the NAT rule.
Beginning with PAN-OS 9.0.2 and in later 9.0 releases, when you configure a destination NAT policy rule that performs static translation of IPv4 addresses, you can also configure the rule so that the firewall rewrites the IPv4 address in a DNS response based on the original or translated IP address configured for the rule. The firewall performs NAT on the IPv4 address (the FQDN resolution) in a DNS response (that matches the rule) before forwarding the response to the client; thus, the client receives the appropriate address to reach the destination service.
View the DNS rewrite use cases to help you determine whether to specify that the rewrite occur in the
reverse
or
forward
direction.
You cannot enable
Bi-directional
source address translation in the same NAT rule where you enable DNS rewrite.
  1. Create a destination NAT policy rule that specifies the firewall perform static translation of IPv4 addresses that match the rule, and also specifies the firewall rewrite IP addresses in DNS responses when that IPv4 address (from the A Record) matches the original or translated destination address in the NAT rule.
    1. Select
      Policies
      NAT
      and
      Add
      a NAT policy rule.
    2. (
      Optional
      ) On the
      General
      tab, enter a descriptive
      Name
      for the rule.
    3. For
      NAT Type
      , select
      ipv4
      .
    4. On the
      Original Packet
      tab, for
      Source Zone
      ,
      Add
      the appropriate zone
    5. For
      Destination Zone
      , select the appropriate zone.
    6. (
      Optional
      )
      Add
      Source Address
      ,
      Destination Address
      ,
      Destination Interface
      , and/or
      Service
      to further define the rule.
    7. On the
      Translated Packet
      tab, for Destination Address Translation, select
      Translation Type
      to be
      Static IP
      .
    8. On the
      Translated Packet
      tab, for Destination Address Translation, select
      Translation Type
      to be
      Static IP
      .
    9. Enable DNS Rewrite
      and select a
      Direction
      :
      • Select
        reverse
        (default) when the IP address in the DNS response requires the opposite translation that the NAT rule specifies.
      • Select
        forward
        when the IP address in the DNS response requires the same translation that the NAT rule specifies.
    10. Click
      OK
      .
  2. Commit
    your changes.

Related Documentation