Repository navigation
Minor Release
This contains Network Bound profiles, new cache and log level options, and fixes for DNS leaks during network changes on Windows, VPN DNS on macOS, DNS64 on IPv6-only networks, and upgrades on low-memory routers.
Added
- Added Network Bound profiles. A profile marked Network Bound in Control D is enforced only while the endpoint is on the organization's network, which ctrld detects from the DNS suffixes of its interfaces (VPN interfaces included) matching an Internal Domain. Off the network, every query goes to the OS resolver and nothing, Active Directory names included, reaches Control D. Leaving the network takes effect only when the new network still shows no match 10 seconds after a network change. Each change of state is logged and flushes the response cache and the OS DNS cache, and
ctrld statusprints the state. Routers and mobile ignore the setting - Added the
cache_negative_ttlandcache_servfail_ttlservice options.cache_ttl_overrideapplies to every answer, so a transient NXDOMAIN or SERVFAIL was kept for the full override.cache_negative_ttlsets the lifetime of NXDOMAIN and NODATA answers, andcache_servfail_ttlthat of SERVFAIL, falling back tocache_negative_ttl - Added the
cache_ttl_minandcache_ttl_maxservice options, to bound cache lifetimes without overriding every TTL.cache_ttl_minraises a shorter TTL of a positive answer only, so a short negative answer is not kept longer.cache_ttl_maxlowers a longer TTL of any answer.cache_ttl_override,cache_negative_ttlandcache_servfail_ttlwin over both. Note thatcache_ttl_minalso stretches a block answered with an address record - Added
--log-leveltoctrld runandctrld start, to set the log level when the config has none. With--logand nolog_level, ctrld logs at debug, so every DNS query name reaches the file, and the Control D Utility could not change the config of a--cdrun to prevent that. With--log-level notice, noQUERYorREPLYline reaches the log. Without--login--cdmode, it also sets the level of the internal log files in place of the forced debug. Alog_levelin the config, including an Endpoint's custom config, still wins, and-v/-vvwin over both.ctrld startkeeps the flag in the installed service's arguments
Changed
- Synced the DNS configuration code with Tailscale v1.104.7, from v1.74.0. This brings in the upstream SELinux fix that restores the security context of
/etc/resolv.confafter ctrld replaces it - Changed the exit code of
ctrld stop,uninstallandstartto 125 when the deactivation PIN cannot be verified because the Control D API has not answered during this run. It was 126, the same as "PIN required", so the desktop app asked users with no PIN for one during an API outage. Other PIN failures keep 126 - Reported only a real person as the Windows username. Provisioning fell back to the profile with the lowest RID in the registry, which could report an unrelated local account, for example on an AD-joined host provisioned over SSH. It now uses the active console session, then the active remote session, then the account that ran the installer if it is a user account (not SYSTEM, a service, or a name ending in
$). Otherwise it sends no username and the API keeps its stored value. Daemon start uses the console session only, so a helpdesk RDP session no longer re-tags the computer - Added ctrld's settings to dnsmasq on Asuswrt-Merlin through the
dnsmasq.postconfanddnsmasq-sdn.postconfhooks instead of replacing/jffs/configs/dnsmasq.conf. The replacement file stopped router changes made after ctrld started, such as a new DHCP reservation, from reaching dnsmasq until ctrld restarted. Older firmware whose hook does not run falls back to the old file, and the Merlin service now serializes start, stop and restart
Fixed
- Kept DNS on ctrld during network-change recovery on Windows in Standard mode. Recovery reset the adapter DNS to DHCP first and pointed it back at ctrld only after an upstream answered, so Windows sent lookups made in that window to the network's resolver in plaintext. ctrld now probes the upstreams for up to 5 seconds with its DNS settings in place and resets them only when no upstream answers (keeping captive portals working), when ctrld writes a non-loopback adapter DNS, or on an IPv6-only network without CLAT where Windows reports no resolver. In that last case, the reset now runs behind temporary filters that block port 53 for every process but ctrld, which are removed when ctrld exits, so other lookups fail instead of leaking
- Stopped sending queries to the previous network's DNS after a move on Windows in Standard mode. Until Windows reported the new network's nameservers, LAN names and the upstream-failure fallback went to the old network's resolver in plaintext. ctrld now sends nothing to those nameservers until a read finds the new ones, for at most 30 seconds, and NAT64 discovery waits instead of querying them
- Sent VPN DNS queries from the VPN adapter's address in Intercept mode on Windows. Queries to VPN DNS servers and Internal Domain resolvers left from the physical address, so an IPsec tunnel that matches traffic by source address, such as FortiClient IPsec, never carried them. Internal Domain failures caused by a missing address now report
source_unavailableon Windows too - Turned on DNS64 synthesis on IPv6-only Windows networks without CLAT. ctrld looked for the default-route interface only among IPv4 routes, found none, and turned synthesis off without a log line. It now uses the IPv6 default route, retries a failed NAT64 prefix discovery after 5 seconds on the same network, and no longer drops the prefix when Windows adds a temporary IPv6 or an APIPA address
- Reached Control D over IPv6 when a pinned IPv4 bootstrap IP fails, for example on an IPv6-only network without CLAT. A DoH or DoH3 upstream with
bootstrap_ipdialed only that address, and any network error turned IPv6 off, including an IPv4 "network unreachable". ctrld now tries the other direct IPs of the allowed family after the pinned one fails, and turns IPv6 off only after an IPv6 dial fails - Sent the NAT64 prefix discovery lookup (
ipv4only.arpa) to the network's resolver. On an IPv6-only macOS network in Standard mode, Control D answered it with no address, so macOS did not start its CLAT and IPv4-only sites stayed unreachable. The answer is not cached - Stopped answering a VPN-routed name with a negative answer while the VPN's DNS is unreachable on macOS. ctrld fell back to its normal upstreams, which cannot know the VPN's names, and macOS cached their negative answer, so the name stayed broken after the VPN was back. ctrld now sends no reply in that case so the client retries. A positive answer from the fallback is still served
- Treated a VPN's domain-less DNS resolver as VPN DNS on macOS. VPNs such as GlobalProtect set their DNS servers as the system's main resolver without naming domains, so ctrld treated them as the local network's DNS, and a home router could win for Internal Domain names that also exist publicly. Such a resolver whose servers route through a tunnel is now VPN DNS, including when macOS keeps the Wi-Fi network's search domain (such as
lan) on it - Kept a VPN's split-DNS route on macOS when a scoped resolver shares its domain. A home router handing out the company's DNS domain could take that domain from the VPN, such as Tailscale, so lookups in it went to the router and got NXDOMAIN. A scoped resolver no longer replaces a domain that a non-scoped resolver serves
- Capped negative answers from VPN DNS servers in the cache. The VPN DNS split-routing path ignored the cache options, and an NXDOMAIN while a VPN came up could be cached for an hour on a default Active Directory zone. It now follows the cache options and caps negative answers at 60 seconds by default
- Used the smallest record TTL as the cache lifetime. ctrld cached an answer for the TTL of its first record and rewrote every record to it, so in a CNAME chain the alias TTL extended short CDN and load-balancer TTLs for ctrld and every downstream cache. The SOA MINIMUM also bounds the lifetime of a negative answer (RFC 2308)
- Truncated UDP answers to the client's EDNS buffer size (or 512 bytes without EDNS) and set TC. Larger answers were sent whole, so a DNSSEC-validating forwarder such as dnsmasq with
edns-packet-max=1232could not validate large DNSKEY sets and returned SERVFAIL - Forwarded root zone queries (
NS .,DNSKEY .) instead of answering FORMERR, which made downstream DNSSEC validators mark signed domains bogus - Kept in-flight queries when one query times out. A timeout rebuilt the upstream transports and closed the old ones, cancelling every other query on the same healthy connection. Old transports now finish their requests before they are retired. This applies to DoH, DoH3, DoQ and DoT
- Finished the DoQ handshake before taking over DNS at start. On Windows, the first QUIC handshake made the OS look up certificate servers through ctrld, which could not answer until that same handshake finished. Queries stalled for about 12 seconds and the OS resolver fallback sent them to the LAN resolver in plaintext
- Restricted log files on Windows to SYSTEM, Administrators and the user that runs ctrld. They took the access list of their folder, so in a Control D Utility install every local user could read
ctrld.logand the DNS query names of every user. Existing files and backups get the new access list when logging starts - Fixed upgrades on low-memory routers:
- Streamed the upgrade download to disk instead of holding it in memory. Installing a 25 MiB binary allocated about 106 MiB, and the upgrade ran out of memory on a 256 MB EdgeRouter X
- Stopped reporting an upgrade successful when the new service dies after the readiness check, as on a FreshTomato R7000 that refuses memory. ctrld now requires the service to keep running for a few seconds, restarts it once, and rolls back if it still does not stay up. The FreshTomato service script keeps ctrld's error output in its log file
- Stopped
ctrld upgradefrom hanging forever when a stopped service reading is followed by status errors. Such a stop is now counted after two more polls and goes down the restart and rollback path
- Made the Firewalla dnsmasq config readable by dnsmasq. Firewalla runs dnsmasq as a non-root user and can reload it after dropping root, and the file was written readable by root only
- Kept watching DHCP lease files that the DHCP server replaces by rename, so client names and addresses stay up to date
- Kept dots in Asuswrt-Merlin custom client names. They are display names, not hostnames, and were cut at the first dot, so "Device 2.5Gbps" became "Device 2"
- Fixed data races in the DNS handler's reads of the cache and upstream state during a config reload, and in the upstream transports during a re-bootstrap
- Fixed ctrld stop and ctrld uninstall being refused after 30 s with "deactivation pin is invalid" when the Control D API never answers. The PIN check now stops waiting for the API after 10 s and uses the last answer ctrld got from it. When the PIN can't be checked, the command exits 125 instead of 126 (CLI only).