Scope/Audience
- Shared private resolver operators are typically ISPs or similar hosting service providers. They offer DNS resolution services to their customers (mobile, cable/DSL/fiber residential and commercial users, as well as hosted servers and applications). The client or host is using the ISP to access the rest of the Internet.
Availability and resiliency of the DNS service
- MUST: Do not mix authoritative and recursive name servers on the same DNS infrastructure.
- MUST: Have at least one backup resolver, which clients are configured to use in case of failure of the primary. Solutions using a load balancer in front of multiple servers usually aren’t practical because they introduce complexity, and stateful systems risk being overwhelmed by DoS/malware related traffic from infected clients.
An acceptable alternative to configuring a secondary resolver, is to deploy Anycast so that multiple resolvers respond to queries sent to a unique resolver IP address. - MUST: Have software diversity. The primary and backup resolvers must be running software packages from different vendors. If Anycast is deployed, use software from two different vendors in the same anycast server pool.
- MUST: Enable monitoring of your services, servers, and network equipment that make up your DNS infrastructure.
Network security
- MUST: Implement BCP38/MANRS - egress filtering, so that no network traffic can leave your network with a source IP address that is not assigned to your network.
- MUST: Use ACLs to restrict who can send queries to the resolvers. Only clients from your known customer IP address ranges should be permitted to send traffic to the shared resolvers. Only allow DNS traffic and associated ICMP response codes to your DNS servers. Disable access to other services and ports on your network for those systems running DNS. This applies to DNS resolvers in both private and public IP space.
- SHOULD: Avoid enabling stateful packet filtering / reflexive access-lists in front of a DNS server. Very active DNS servers can easily overwhelm stateful packet filters and load balancers.
Host and service security
- MUST: Lock down the host configuration (hardening).
- MUST: Uninstall/disable services and software packages that are not required for offering DNS service on the system.
- MUST: Only run DNS software on the systems that will be offering DNS service (i.e.: do not co-locate with web server / mail server, etc.).
- MUST: Enable all relevant logging channels and levels for the DNS subsystem, including suitable retention policies. Send logs to a central location for archiving, inspection and auditing.
- MUST: Configure the DNS service itself to only respond to queries originating from known subnets. This is to avoid probing and leaking of internal DNS information in case of misconfiguration of routing/perimeter security (ACLs).
- MAY: Query logging for audit purposes/incident analysis (local laws and regulations permitting).
- MUST: Limit user permissions and application access to system resources. File permissions and ownership restrictions should be set so that users and services not directly associated with management of the DNS subsystem have no read or write access to DNS service configuration, data files and database subsystems.
- MAY: Consider using AppArmor or another capabilities-based security mechanism to restrict which files and resources the DNS subsystem is allowed to access on the host OS.
- MAY: Consider placing the DNS service and associated support services in a containerized environment.
- MUST: System and service configuration files must be versioned, enabling detection of corruption/unauthorized changes, and making it possible to roll back changes.
- MUST: Filter access to management services
- MUST: Restrict access to management IP addresses and services (e.g: SSH, web-based configuration tools).
- MUST: Close everything except DNS by default
- MUST: Restrict access to management IP addresses and services (e.g: SSH, web-based configuration tools).
- MUST: Secure access to the system console using cryptographic keys, protected with a passphrase (e.g. SSH keys) or using suitable two-factor authentication (OTP generator or token-based).
DNS security and privacy
- MUST: Enable DNSSEC validation.
- MUST: Enable QNAME minimization to minimize leakage of domain names.
SHOULD: Enable DoT (DNS-over-TLS), or DoH (DNS-over-HTTPS). Deploying either is the easiest way to protect against eavesdropping and manipulation of DNS queries and man-in-the-middle attacks by encrypting DNS queries between stub and recursive resolvers, or between a forwarding and recursive resolver.
In the context of shared private resolvers, it is recommended that DoT or DoH be enabled between the resolver on the local network(s), and an external, trusted DoT/DoH enabled forwarding resolver. This ensures that DNS queries being forwarded from local clients are encrypted between the local resolver, and the external forwarder.
Additionally, a DoT and/or DoH service should be offered to local clients and resolvers. While DoT and DoH may reduce the visibility that local administrators have into the queries being forwarded by the local recursive resolver to an upstream DoT service, it will still be possible to monitor queries between clients and the local DNS resolver, either using passive DNS analysis (if using unencrypted DNS), or query logging.
Finally, DoT and DoH do not guarantee end-to-end privacy, only protection from third party eavesdropping between hops that use DoT/DoH: the resolver that queries are being forwarded to should also use DoT/DoH when performing resolution.