dns_HTTPS() function tests your network’s ability to detect and control DNS over HTTPS (DoH) usage. While DoH provides privacy benefits, unmanaged DoH can bypass DNS security controls and reduce network visibility.
Security Context
DNS over HTTPS (DoH) encrypts DNS queries using HTTPS, which:- Privacy Benefit - Prevents DNS query surveillance and manipulation
- Security Risk - Bypasses DNS filtering and content controls
- Visibility Loss - Hides DNS queries from security monitoring
- Policy Bypass - Circumvents organizational DNS policies
How It Works
Send DoH Queries
Sends DNS queries over HTTPS to both Google and Cloudflare DoH servers for each domain.
DoH Providers Tested
Google Public DNS
- DoH Endpoint -
https://dns.google/resolve - Description - Google’s public DoH resolver service
- Features - Fast, reliable, JSON API support
Cloudflare DNS
- DoH Endpoint -
https://cloudflare-dns.com/dns-query - Description - Cloudflare’s privacy-focused DoH service
- Features - Low latency, privacy-centric, GDPR compliant
These are the two most popular public DoH providers. Others include Quad9, OpenDNS, and AdGuard DNS.
Output Format
Results are saved to DoH_Results.txt with the following format:What to Monitor
HTTPS Traffic Analysis
Monitor HTTPS connections to known DoH provider endpoints (dns.google, cloudflare-dns.com).
DNS Bypass Detection
Detect when systems bypass your internal DNS resolvers.
TLS Inspection
Use TLS inspection to identify DoH traffic patterns (with appropriate legal considerations).
Policy Enforcement
Enforce DNS policy by blocking or redirecting DoH traffic to managed services.
Security Implications
Loss of DNS Visibility
Loss of DNS Visibility
Unmanaged DoH prevents security teams from:
- Monitoring DNS queries for threat detection
- Identifying malware C2 communications
- Detecting data exfiltration via DNS
- Analyzing user browsing patterns
- Enforcing content policies
Bypassing Security Controls
Bypassing Security Controls
DoH can circumvent:
- DNS-based content filtering
- Malware domain blocking
- Phishing site prevention
- Category-based web filtering
- Parental controls
Data Exfiltration Risk
Data Exfiltration Risk
Threat actors may use DoH to:
- Hide C2 communications in HTTPS traffic
- Exfiltrate data through DNS tunneling
- Avoid detection by DNS security tools
- Bypass DNS-based threat intelligence
Compliance Concerns
Compliance Concerns
Unmanaged DoH may violate:
- Corporate acceptable use policies
- Regulatory monitoring requirements
- Data governance policies
- Legal intercept obligations
- Industry compliance standards
Managed vs. Unmanaged DoH
Managed DoH Services (Recommended)Enterprises should use managed DoH/DoT services that provide:
- Security filtering and threat intelligence
- Policy enforcement capabilities
- Logging and visibility
- Compliance features
- Cisco Umbrella
- Zscaler DNS Security
- Cloudflare for Teams
- Quad9 Enterprise
Testing Workflow
Detection Strategies
Block Known DoH Endpoints
Create firewall rules to block connections to public DoH provider IP addresses and domains.
Monitor HTTPS Patterns
Analyze HTTPS traffic for DoH-specific patterns:
- DNS JSON format in HTTPS requests
- Connections to known DoH endpoints
- High frequency of short HTTPS requests
DNS Canary Domains
Use canary domains that should only be queried through internal DNS to detect bypass attempts.
Public DoH Providers to Consider Blocking
Common public DoH services that bypass enterprise controls:- Google Public DNS -
dns.google,8.8.8.8,8.8.4.4 - Cloudflare DNS -
cloudflare-dns.com,1.1.1.1,1.0.0.1 - Quad9 -
dns.quad9.net,9.9.9.9 - OpenDNS -
doh.opendns.com - AdGuard DNS -
dns.adguard.com - NextDNS -
dns.nextdns.io
Security Controls to Validate
- Firewall Rules - Block connections to public DoH provider IPs and domains
- DNS Enforcement - Ensure endpoints use only approved DNS resolvers
- TLS Inspection - Inspect HTTPS traffic to identify DoH usage (where legally permitted)
- Network Policies - Prevent DNS resolver changes on managed devices
- SIEM Detection - Alert on connections to known DoH endpoints
- Endpoint Controls - Use MDM/GPO to enforce DNS settings
Recommended Approach
- Audit Current State - Identify if DoH is being used in your environment
- Define Policy - Determine if managed DoH services meet your needs
- Implement Controls - Block public DoH or migrate to managed DoH
- Monitor Compliance - Continuously detect DoH bypass attempts
- User Education - Explain why unmanaged DoH is blocked
Some browsers (Firefox, Chrome, Edge) have built-in DoH support that may be enabled by default. Configure browser policies to disable or redirect DoH to your managed DNS service.
Browser DoH Configuration
Major browsers support DoH:- Firefox - Can be disabled via
network.trr.modesetting - Chrome/Edge - Uses system DNS by default but supports DoH
- Safari - Uses system DNS resolver settings