FQDN address objects do not match traffic without DNS proxy in the LAN VR


Summary

A forwarding rule or access policy rule that uses an FQDN or wildcard FQDN address object does not match traffic to that domain. The session is handled by Default-Rule and follows the default route instead of the forwarding profile that the FQDN rule selects.

An FQDN address object is matched against the destination IP of the flow, so the device has to know which IP addresses belong to the domain. It learns them from the DNS answers it handles. When clients resolve through an internal DNS server directly and the LAN routing instance has no DNS proxy settings, the device never sees those answers and the rule never matches. Configuring DNS proxy settings in the LAN routing instance, with the same DNS servers the clients use, resolves the issue.

Applies to

Symptoms

The SD-WAN policy rule that selects the forwarding profile and the access policy rule both reference the FQDN object, are enabled, and sit above Default-Rule. Traffic to the domain still takes the default route learned from the hub.

The session shows that the FQDN rule was not hit. For a ping to the domain, the session output includes these fields:

show orgs org <org> sessions extensive | select source-ip <client-ip> | select destination-ip <resolved-ip> | match-all
  pbf-enabled                     false
  forward-sdwan-rule-name         Default-Rule
  access-policy                   <a later, general rule>

The destination IP in the session is one of the addresses the domain resolves to, so the name resolves correctly on the client. The device just has no mapping from that IP to the domain.

Cause

Matching on an FQDN object depends on a per-tenant mapping of IP addresses to domain names, the IP to Domain Cache. It is part of the tenant DNS settings and is enabled by default. The mapping is built from DNS answers that pass through the device's DNS proxy.

In the failing setup the clients use the internal DNS servers they receive from DHCP. The LAN routing instance has no DNS proxy settings, and the only name servers on the device are on the transport routing instances. The device never sees the answers, so the cache has no entry for the destination IP and the rule does not match.

Wildcard objects such as (.*\.|^)example\.com cannot be looked up by querying a name, so they depend completely on the mapping. A resolver on the wrong routing instance, or a public resolver that returns different IP addresses than the internal servers the client used, causes the same result.

Resolution

Configure DNS proxy settings in the LAN routing instance so that the device handles the client DNS queries and forwards them to the same servers the clients already use.

  1. Open the tenant DNS settings and set Routing Instance to the LAN VR where the clients are.
  2. Add as forwarders the DNS servers that the clients receive from DHCP. Do not use a public resolver. This keeps internal names working and makes the device see the same answers as the client.
  3. Leave IP to Domain Cache enabled. Cache Size and Maximum TTL are optional. Set Default Resolver Redirection Policy to the policy that holds your redirection rules.
  4. Create a DNS proxy profile with a resolver that points to the same DNS servers (port 53). Add a redirection rule for the LAN zone that matches the domains in DNS Headers Match and selects the profile in Proxy Setting. Make sure the client DNS queries pass through the LAN VR so the proxy handles them, for example by handing out the LAN VR interface address as the DNS server.
  5. Define the FQDN address objects so that they cover the whole domain, the bare name and every subdomain, and escape the dot before the top-level domain:
    (.*\.|^)example\.com
    A pattern such as .*proxy\.example\.com matches only names that end in proxy.example.com.
  6. Use the objects as the destination address in the SD-WAN policy rule that selects the forwarding profile and in the access policy rule. Keep both rules above Default-Rule and above any general rule that would match the traffic first. Disable older rules that match the same destination, for example policy-based forwarding rules with a fixed next hop, because they are evaluated first and the traffic never reaches the forwarding profile rule.
  7. Verify from a client. Run a lookup for a name in the domain, then send traffic to an address it returns and check the session:
    show orgs org <org> sessions extensive | select source-ip <client-ip> | select destination-ip <resolved-ip> | match-all
      forward-sdwan-rule-name         <the FQDN rule>
      forward-egress-ckt              <the WAN circuit from the forwarding profile>

The figures below are from a lab setup. The lab forwarder is a public resolver. In production, use the DNS servers your clients use.

Figure 1. DNS Settings. Routing Instance is the LAN VR, a forwarder is set, Default Resolver Redirection Policy is Default-Policy and IP to Domain Cache is enabled.
Edit DNS Settings dialog

Figure 2. Proxy profile in Fail Over mode with a resolver. The resolver lists the DNS server and port 53.

Edit Resolver dialog inside a proxy profile

Figure 3. DNS redirection rule under Default-Policy for the LAN zone. The DNS Headers Match tab holds the domain name patterns. The Proxy Setting tab selects the proxy profile.

Edit Redirection Rules dialog with DNS Headers Match tab

Figure 4. SD-WAN policy rule, Destination tab. The destination addresses are two FQDN address objects.

SD-WAN policy rule Destination tab

Additional information