Edit

Use FQDN filtering in network rules

A fully qualified domain name (FQDN) represents the complete domain name of a host or one or more IP addresses. In Azure Firewall and Firewall policy, you can use FQDNs in network rules based on DNS resolution. This feature allows you to filter outbound traffic by using any TCP or UDP protocol, including NTP, SSH, and RDP. To use FQDNs in your network rules, you must enable DNS Proxy. For more information, see Azure Firewall DNS settings.

You can specify an exact FQDN, such as www.contoso.com, or a wildcard FQDN, such as *.contoso.com. For more information, see Use wildcard FQDNs in network rules.

How it works

First, define the DNS server your organization uses (either Azure DNS or a custom DNS). Azure Firewall then translates the FQDN to an IP address or addresses based on the chosen DNS server. This translation applies to both application and network rule processing.

When a new DNS resolution occurs, new IP addresses are added to the firewall rules. Old IP addresses expire after 15 minutes if the DNS server no longer returns them. Azure Firewall updates its rules every 15 seconds based on the DNS resolution of the FQDNs in network rules.

Differences between application rules and network rules

  • FQDN filtering in application rules for HTTP/S and MSSQL relies on an application-level transparent proxy and the SNI header. This reliance allows it to differentiate between two FQDNs that resolve to the same IP address. This capability isn't available with FQDN filtering in network rules.

    Always use application rules when possible:

    • For HTTP/S or MSSQL protocols, use application rules for FQDN filtering.
    • For services like AzureBackup and HDInsight, use application rules with FQDN tags.
    • For other protocols, use network rules for FQDN filtering.

Use wildcard FQDNs in network rules

You can use a wildcard FQDN, such as *.contoso.com, in a network rule to allow or deny traffic. This capability is useful when a service continuously adds or removes endpoints under a domain.

Wildcard FQDNs in network rules have the following behavior and requirements:

  • Syntax: Wildcards are supported everywhere within the domain name, but consecutive wildcards aren't allowed.
  • Performance: For best results, use prefix and suffix wildcards as they are more efficient than complex wildcards, which might affect performance.
  • DNS proxy is required: Azure Firewall discovers the IP addresses for matching subdomains from the DNS responses it observes. Enable DNS proxy and configure client virtual machines to use Azure Firewall as their DNS server so that all DNS traffic passes through the firewall. For more information, see Azure Firewall DNS settings.
  • Learned addresses: Because the firewall learns IP addresses from observed DNS responses, the initial connection to a newly resolved subdomain might be briefly delayed until the firewall programs the address.

Note

Wildcard domains in network rules are supported in the following regions currently - West Central US, East Asia, and UK South.

Next steps

Azure Firewall DNS settings