Palo Alto Networks DNS Security Deep Dive (PCNSE Focus)

DNS Security is a critical component of the Palo Alto Networks platform, designed to combat threats that leverage the Domain Name System (DNS). It utilizes a combination of cloud-based threat intelligence, machine learning, and firewall policy enforcement to prevent connections to malicious domains associated with malware, command-and-control (C2), phishing, and other threats like DNS Tunneling and Domain Generation Algorithms (DGA).

PCNSE Exam Focus: Core concepts include understanding that DNS Security is configured primarily within an Anti-Spyware Profile , requires specific licenses (DNS Security + Threat Prevention or Advanced bundles), involves cloud lookups and local caching, and enforces actions like allow , block , or sinkhole . Know the key configuration steps, verification methods (logs, CLI), the purpose of sinkholing, how exceptions work, and the basics of Advanced DNS Security, DoT/DoH inspection.

Enable DNS Security

Base DNS Security functionality is enabled by configuring DNS policy actions within an Anti-Spyware profile and applying that profile to Security Policy rule(s) that permit DNS traffic (typically UDP/53 and TCP/53).

Prerequisites & Initial Verification

  1. Licenses: Verify active DNS Security AND Threat Prevention (or Advanced Threat Prevention / Advanced URL Filtering) licenses under Device > Licenses . DNS Security leverages TP threat intelligence. The specific categories available may depend on the exact license bundle.
  2. Content Database: Ensure the firewall has a recent Applications and Threats content database installed ( Device > Dynamic Updates ). DNS signatures are delivered via these updates.
  3. Connectivity: The firewall requires HTTPS (TCP/443) connectivity to the Palo Alto Networks DNS Security cloud ( dns.service.paloaltonetworks.com globally, or regional clouds like dns.eu.service.paloaltonetworks.com ). Configure Service Routes ( Device > Setup > Services > Service Route Configuration ) if the Management interface lacks internet access. Verify connectivity using show dns-proxy dns-signature info .
  4. App-ID Allow (Perimeter): If management/service route traffic traverses another firewall, ensure the paloalto-dns-security App-ID is allowed on that perimeter device.
  5. DNS Proxy/Resolution: The firewall itself must be able to resolve external FQDNs for cloud connectivity. Configure DNS servers under Device > Setup > Services . Consider using DNS Proxy ( Network > DNS Proxy ) for internal clients if you want the firewall to handle their DNS requests directly.

Configuration Steps (PAN-OS 10.x/11.x+)

The main configuration is done within an Anti-Spyware profile.

  1. Navigate to Objects > Security Profiles > Anti-Spyware .
  2. Create a new profile or clone/modify an existing one (cloning 'default' is a good starting point). Give it a descriptive name.
  3. Select the DNS Policies tab.
  4. Configure Actions per Signature Source: This section lists DNS threat categories derived from cloud lookups and content updates. For each category (Malware, C2, Phishing, DGA, DNS Tunneling, Grayware, Parked, DDNS, Newly Registered Domain (NRD), etc.):
    • Set the desired Policy Action :
      • allow : Permits the DNS query. Useful for benign categories or for monitoring specific threats without blocking (set Log Severity appropriately).
      • block : Drops the DNS query. The client typically receives a timeout or server failure error from its resolver.
      • sinkhole : Forges a DNS response, redirecting the client to a configured Sinkhole IP address. This is the recommended action for many malicious categories (Malware, C2, Phishing) as it helps identify potentially compromised hosts.
      • default : Uses the Palo Alto Networks recommended action for the category (viewable in the profile). It's generally advised to explicitly set actions rather than relying on default.
    • Set the Log Severity (Critical, High, Medium, Low, Informational, None). Logging is crucial for visibility. Best practice often involves logging Medium, High, and Critical events. Informational might be used for categories like Parked or NRD if monitoring is desired.
    • (Optional) Enable Packet Capture : single-packet or extended-capture for deeper analysis of specific threat types, though this increases resource usage.
    PCNSE Exam Focus: Know the available actions (allow, block, sinkhole) and their effects. Understand that sinkhole is used for *identification* of potentially compromised hosts by redirecting their malicious requests. Recognize common category names (Malware, C2, DGA, Tunneling, Phishing, NRD, Grayware, Parked, DDNS).
  5. Configure DNS Sinkhole Settings:
    • Enable the Sinkhole checkbox if using the sinkhole action for any category.
    • Configure Sinkhole IPv4 and/or Sinkhole IPv6 .
      • Default FQDN: sinkhole.paloaltonetworks.com . Easiest to manage as PAN updates the IP. Relies on client/internal DNS correctly resolving the CNAME provided by the firewall in the forged response.
      • Palo Alto Networks IP: 72.5.65.111 (IPv4). Use this if clients might bypass internal DNS or have issues resolving the FQDN CNAME.
      • Custom IP: An internal server IP (configured with a web server or listener) or a loopback address on the firewall. Allows monitoring traffic *to* the sinkhole IP via firewall logs or the internal server.
    PCNSE Exam Focus: Understand sinkhole configuration options, the difference between FQDN and IP, and when to use each based on client DNS behavior. Know the default Palo Alto sinkhole IP.
  6. (Optional in DNS Policies Tab) Block ECH RR Types: Block specific DNS Resource Record types (SVCB Type 64, HTTPS Type 65, ANY Type 255) if policy requires preventing Encrypted Client Hello negotiation.
  7. Click OK to save the Anti-Spyware profile.
  8. Apply Profile to Security Policy:**
    • Navigate to Policies > Security .
    • Identify or create rule(s) allowing outbound DNS traffic. Ensure the rule correctly identifies DNS traffic:
      • Application: Should ideally be set to dns to catch DNS on standard and non-standard ports. Using specific App-IDs like google-dns is possible but less comprehensive.
      • Service: application-default (uses standard ports defined for the matched application) or a custom service object for UDP/53 and TCP/53.
    • Go to the rule's Actions tab.
    • Under Profile Setting > Type: Select Profiles .
    • In the Anti-Spyware dropdown, select the configured DNS Security profile.
    • Ensure Log at Session End is checked for general traffic visibility. DNS Security actions generate Threat logs independently based on profile severity settings.
    • Click OK .
  9. Commit the configuration changes to the firewall.

Anti-Spyware Profile DNS Policies Tab - Detailed View

PAN-OS 10.0+ Upgrade Note: Upon upgrading to PAN-OS 10.0 or later, the DNS Security categories are restructured. This means any custom actions (block/sinkhole/allow) or logging severities configured for the older categories will be overwritten by the default settings of the *new* categories. You MUST review and reapply your desired settings to the new categories within the Anti-Spyware profile after such an upgrade.

Verification Methods


Enable Advanced DNS Security

Advanced DNS Security (requires PAN-OS 11.2+, Content 8832+) enhances protection by adding real-time analysis of DNS responses using cloud-based machine learning to detect DNS hijacking (malicious redirection) and monitoring configured zones for DNS misconfigurations.

Prerequisites & Licensing

  1. Base DNS Security configured and functional.
  2. PAN-OS 11.2+ and Applications and Threats Content Release 8832+.
  3. Active Advanced DNS Security license (subsumes base DNS Security license). Verify under Device > Licenses .
    The Advanced DNS Security license subsumes the base DNS Security license. If you have both, the Advanced license governs functionality and expiry. Downgrading PAN-OS retains base DNS functionality under the Advanced license.
  4. Updated Firewall Device Certificate ( Device > Certificates > Device Certificates ) for cloud authentication.
  5. Connectivity to Advanced DNS Security cloud (`adv-dns.service.paloaltonetworks.com`).
  6. (If applicable) Proxy server configured for Inline Cloud Services ( Device > Setup > Services , PAN-OS 11.2.3+).

License Verification Example

Configuration Steps

  1. Navigate to the relevant Anti-Spyware profile's DNS Policies tab ( Objects > Security Profiles > Anti-Spyware ).
  2. Configure Log Severity and Policy Action for the "Advanced DNS Security" categories:
    • DNS Misconfiguration Domains : Detects issues like dangling records within your own configured zones. Action typically alert or allow with logging.
    • Hijacking Domains : Detects malicious redirection in DNS responses. Action typically block or sinkhole .
    • (PAN-OS 11.2+) Additional categories like adns-malware , adns-c2 etc., based on real-time response analysis. Configure actions according to security policy.
    PCNSE Exam Focus: Differentiate Advanced categories (Hijacking, Misconfiguration) from base categories. Note the adns- prefix in logs for threats found via *response* analysis.
  3. (Optional) Add your organization's public parent domains (e.g., `mycompany.com`) to the DNS Zone Misconfigurations list within the profile's DNS Policies tab to enable monitoring of those specific zones. TLDs/root domains cannot be added.
  4. (Optional) Adjust the Advanced DNS Security Timeout under Device > Setup > Content-ID > Advanced DNS Security (Default: 100ms). CLI: set deviceconfig setting adns-setting max-latency . If lookup exceeds timeout, analysis is skipped for that query.
  5. Commit changes.

Advanced DNS Security Categories Configuration

DNS Zone Misconfigurations List Config

Advanced DNS Timeout Setting GUI Snippet

Verification Methods

Threat Log Detail Showing ADNS Category

Strata Cloud Manager Misconfigured Domains Widget

Strata Cloud Manager Hijacked Domains Widget


DNS Security Over TLS (DoT) Inspection

DoT encrypts standard DNS queries using TLS, typically over TCP port 853 . Inspection requires decrypting this specific traffic.

  1. Decryption Policy:** Create a rule in Policies > Decryption .
    • Rule Name: e.g., `Decrypt-DoT`
    • Source/Destination Zones/Addresses: Define as needed to match potential DoT traffic flows.
    • Service: Create a custom service object for tcp/853 .
    • URL Category: Typically `any` unless targeting specific DoT servers.
    • Action: Set to Decrypt .
    • Type: Select SSL Forward Proxy .
    • Profile: Attach an appropriate Decryption Profile (e.g., one that blocks sessions with untrusted issuers or expired certificates).
  2. Security Policy:** Ensure a Security Policy rule allows the decrypted DNS traffic.
    • Rule Name: e.g., `Allow-Decrypted-DNS`
    • Source/Destination: As needed.
    • Application: Match dns-base (this is what the decrypted DoT traffic becomes).
    • Service: Match standard DNS ports (e.g., service-udp-53 , service-tcp-53 or use application-default if the `dns-base` app definition includes these).
    • Action: `Allow`.
    • Profiles: Attach the Anti-Spyware profile containing your DNS Security settings.
  3. Commit changes.
PCNSE Exam Focus: Key points are the use of port 853 , the need for an SSL Forward Proxy decryption rule targeting this port, and that the decrypted application becomes dns-base , which then needs to be allowed by Security Policy with the Anti-Spyware profile attached.

Decryption Rule for DoT Example - Policy Snippet


DNS Security Over DoH Inspection

DoH tunnels DNS requests inside HTTPS traffic, typically over TCP port 443 . Inspection requires targeted decryption of known DoH resolvers, as decrypting all HTTPS is impractical and potentially undesirable.

  1. Custom URL Category:** Create a list ( Objects > Custom Objects > URL Category ) named e.g., `Approved-DoH-Resolvers`. Add the specific FQDNs/URLs of the DoH resolvers your organization permits (e.g., `cloudflare-dns.com`, `dns.google`, `dns.quad9.net`).
  2. Decryption Policy:** Create a rule in Policies > Decryption .
    • Rule Name: e.g., `Decrypt-Approved-DoH`
    • Source/Destination: Define as needed.
    • URL Category: Select the Approved-DoH-Resolvers custom category created above.
    • Service: Typically `service-https` or `any`.
    • Action: Set to Decrypt .
    • Type: SSL Forward Proxy .
    • Apply an appropriate Decryption Profile.
  3. Security Policy (Allow Approved):** Create a Security Policy rule placed above general web browsing rules.
    • Rule Name: e.g., `Allow-Inspect-DoH`
    • Source/Destination: As needed.
    • Application: Match dns-over-https .
    • URL Category: Match the Approved-DoH-Resolvers custom category.
    • Service: `application-default` (will resolve to port 443 for DoH).
    • Action: Allow .
    • Profiles: Attach the Anti-Spyware profile with DNS Security settings enabled.
  4. Security Policy (Block Unapproved - Recommended):** Create a Security Policy rule below the allow rule, but generally above broad web access rules.
    • Rule Name: e.g., `Block-Unapproved-DoH`
    • Source/Destination: As needed.
    • Application: Match dns-over-https .
    • URL Category: Match the predefined category encrypted-dns (this category identifies known DoH services).
    • Service: `application-default`.
    • Action: Deny .
  5. Commit changes.
PCNSE Exam Focus: Understand the necessity of using a Custom URL Category for targeted decryption. Know the App-ID (`dns-over-https`) and the predefined URL Category (`encrypted-dns`) used in policy rules. Remember the typical rule order: Allow specific decrypted DoH, Block other DoH, Allow general web.

Traffic Log Showing dns-over-https


Domain Exceptions and Allow / Block Lists

Overrides are configured within the relevant Anti-Spyware profile ( Objects > Security Profiles > Anti-Spyware ).

PCNSE Exam Focus: Understand the precedence order: 1. FQDN Allow List (Bypass) -> 2. DNS Signature Exception (Override specific signature) -> 3. DNS Category Action (Cloud verdict) -> 4. EDL Action (If no conflicting category action). Know where each is configured.

DNS Exceptions Tab - Signature Exclusions

DNS Exceptions Tab - FQDN Allow List


Mermaid Diagrams

DNS Security Basic Flow (Sinkhole Example)

%%{init: { "themeVariables": { "fontSize": "16px" }}}%% sequenceDiagram participant C as Client participant FW as Firewall participant DR as DNS_Resolver participant SS as Sinkhole_Server participant MS as Malicious_Server participant DSC as DNS_Sec_Cloud C->>FW: DNS Query (malicious.com) activate FW FW-->>FW: 1. Check FQDN Allow List? -> No Match FW-->>FW: 2. Check Cache? -> No Match FW->>DSC: 3. Query Signature (malicious.com) activate DSC DSC-->>FW: 4. Response (Category: Malware,
ThreatID: 12345, Action: Sinkhole) deactivate DSC FW-->>FW: 5. Update Cache (malicious.com = Malware/Sinkhole) FW-->>FW: 6. Check Signature Exception? -> No Match FW-->>FW: 7. Apply Category Action: Sinkhole FW->>C: 8. Forged DNS Response (IP_Sinkhole) deactivate FW activate C C->>FW: 9. TCP SYN to IP_Sinkhole (Client tries to connect) activate FW Note over FW: 10. Security Policy likely blocks/alerts traffic to Sinkhole IP FW-->>C: (Likely TCP RST or Drop) deactivate FW deactivate C Note over FW: 11. Threat Log Generated (DNS Malware, Sinkhole, ThreatID: 12345)

DoH Decryption and DNS Security Flow

%%{init: { "themeVariables": { "fontSize": "18px" }}}%% graph TD subgraph Initial Connection A[Client initiates HTTPS\n to DoH Resolver] --> B(Firewall) end subgraph Decryption Policy Check B --> C{URL Category Match?\n DoH Resolver in\n Approved DoH URLs?}; end subgraph Decryption Process C -- Yes --> D(SSL Forward Proxy\n Decryption); D --> E{Decryption OK?}; end subgraph Non DoH / Blocked Decryption C -- No --> F[Treat as normal HTTPS\n or Blocked by other Rule]; E -- No --> G[Log Decryption Error]; end subgraph Security Policy & DNS Security E -- Yes --> H[Extract DNS Payload\n query: target.com]; H --> I{Security Policy Match?\n App: dns-over-https,\n URLCat: Approved DoH URLs,\n Action: Allow?}; I -- Yes --> J[Apply Profiles\n Anti Spyware Profile]; J --> K{DNS Security Check\n Cache/Cloud for target.com}; K -- Malicious/Block --> L[Block DNS Query]; K -- Malicious/Sinkhole --> M[Sinkhole DNS Query]; K -- Allow/Benign --> N[Allow DNS Query]; end subgraph Response Handling N --> O[Re Encrypt & Forward\n to DoH Resolver]; O --> P[Receive Encrypted\n Response]; P --> Q[Decrypt Response]; L --> R[Forge Encrypted\n Block Response]; M --> S[Forge Encrypted\n Sinkhole Response]; Q --> T{Re Encrypt Final\n Response to Client}; R --> T; S --> T; T --> U[Send to Client]; end subgraph Endpoints F --> Z[End Flow] G --> Z I -- No --> Z; U --> Z; end style Z fill:#eee,stroke:#333,stroke-width:2px

DNS Security Quiz

Loading quiz...