Skip to main content
Microsandbox handles DNS queries on the host instead of letting the guest contact a resolver directly. This makes domain rules and DNS rebinding protection possible.

DNS as egress

Every DNS query must pass the sandbox’s egress policy. The public, private, and host profiles already allow DNS through the gateway. With a custom deny-by-default policy, add the equivalent of allow_dns() or use allow@dns in the CLI. Otherwise, every lookup will be denied. DNS over TLS uses TCP port 853 and needs its own allow rule. It also requires TLS interception. DNS rebinding protection is separate from query access. Private or reserved answers are rejected unless an explicit address rule allows them. An allow-by-default policy does not disable this protection. See Network defenses for the full policy behavior.

Blocking domains

Denied domains receive a local NXDOMAIN response and are never sent to the upstream resolver. The same rules also protect connections that use TLS SNI or a recently resolved IP address.

Pinning nameservers

By default, Microsandbox uses the host’s resolver list. Set nameservers when you need specific resolvers. Nameservers can be IP addresses, hostnames, or either form with a port. Hostnames are resolved once when the sandbox starts. Resolvers are tried in order. A timeout or connection failure moves to the next resolver. DNS responses such as SERVFAIL and REFUSED do not. Each unreachable resolver can delay the query by up to query_timeout_ms.
An application can request a specific resolver, such as with dig @1.1.1.1. That request skips the configured default list, but it still has to pass the network policy.

DNS over alternative transports

Domain blocking and rebinding protection apply only to DNS traffic that Microsandbox can identify. Use network rules to control DNS over HTTPS or to restrict which resolvers the guest can reach.

Domain-based policy rules

Microsandbox records the IP addresses returned for each domain. A domain rule matches a later connection only when that sandbox resolved the domain to that IP. An application that connects directly to a hard-coded IP does not match a domain rule. Use an IP or CIDR rule for that traffic.

See also