{"modulePath":"tailscale.com","version":"v1.106.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package controlknobs\n\nPackage controlknobs contains client options configurable from control which can be turned on or off. The ability to turn options on and off is for incrementally adding features in.\n\n## Types\n\n```go\ntype Knobs struct {\n\t// DisableUPnP indicates whether to attempt UPnP mapping.\n\t// Set by [nodecap.DisableUPnP].\n\tDisableUPnP atomic.Bool\n\n\t// RandomizeClientPort is whether control says we should randomize\n\t// the client port.\n\t// Set by [nodecap.RandomizeClientPort].\n\tRandomizeClientPort atomic.Bool\n\n\t// OneCGNAT is whether the node should make one big CGNAT route\n\t// in the OS rather than one /32 per peer.\n\t// Set by [nodecap.OneCGNATEnable] and [nodecap.OneCGNATDisable].\n\tOneCGNAT syncs.AtomicValue[opt.Bool]\n\n\t// ForceBackgroundSTUN forces netcheck STUN queries to keep\n\t// running in magicsock, even when idle.\n\t// Set by [nodecap.DebugForceBackgroundSTUN].\n\tForceBackgroundSTUN atomic.Bool\n\n\t// DisableDeltaUpdates is whether the node should not process\n\t// incremental (delta) netmap updates and should treat all netmap\n\t// changes as \"full\" ones as tailscaled did in 1.48.x and earlier.\n\t// Set by [nodecap.DisableDeltaUpdates].\n\tDisableDeltaUpdates atomic.Bool\n\n\t// PeerMTUEnable is whether the node should do peer path MTU discovery.\n\t// Set by [nodecap.PeerMTUEnable].\n\tPeerMTUEnable atomic.Bool\n\n\t// DisableDNSForwarderTCPRetries is whether the DNS forwarder should\n\t// skip retrying truncated queries over TCP.\n\t// Set by [nodecap.DNSForwarderDisableTCPRetries].\n\tDisableDNSForwarderTCPRetries atomic.Bool\n\n\t// SilentDisco is whether the node should suppress disco heartbeats to its\n\t// peers.\n\t// Set by [nodecap.SilentDisco].\n\tSilentDisco atomic.Bool\n\n\t// LinuxForceIPTables is whether the node should use iptables for Linux\n\t// netfiltering, unless overridden by the user.\n\t// Set by [nodecap.LinuxMustUseIPTables].\n\tLinuxForceIPTables atomic.Bool\n\n\t// LinuxForceNfTables is whether the node should use nftables for Linux\n\t// netfiltering, unless overridden by the user.\n\t// Set by [nodecap.LinuxMustUseNfTables].\n\tLinuxForceNfTables atomic.Bool\n\n\t// ProbeUDPLifetime is whether the node should probe UDP path lifetime on\n\t// the tail end of an active direct connection in magicsock.\n\t// Set by [nodecap.ProbeUDPLifetime].\n\tProbeUDPLifetime atomic.Bool\n\n\t// AppCStoreRoutes is whether the node should store RouteInfo to StateStore\n\t// if it's an app connector.\n\t// Set by [nodecap.StoreAppCRoutes].\n\tAppCStoreRoutes atomic.Bool\n\n\t// UserDialUseRoutes is whether tsdial.Dialer.UserDial should use routes to determine\n\t// how to dial the destination address. When true, it also makes the DNS forwarder\n\t// use UserDial instead of SystemDial when dialing resolvers.\n\t// Set by [nodecap.UserDialUseRoutes].\n\tUserDialUseRoutes atomic.Bool\n\n\t// DisableSplitDNSWhenNoCustomResolvers indicates that the node's DNS manager\n\t// should not adopt a split DNS configuration even though the Config of the\n\t// resolver only contains routes that do not specify custom resolver(s), hence\n\t// all DNS queries can be safely sent to the upstream DNS resolver and the\n\t// node's DNS forwarder doesn't need to handle all DNS traffic.\n\t// This is for now (2024-06-06) an iOS-specific battery life optimization,\n\t// and this knob allows us to disable the optimization remotely if needed.\n\t// Set by [nodecap.DisableSplitDNSWhenNoCustomResolvers].\n\tDisableSplitDNSWhenNoCustomResolvers atomic.Bool\n\n\t// DisableLocalDNSOverrideViaNRPT indicates that the node's DNS manager should not\n\t// create a default (catch-all) Windows NRPT rule when \"Override local DNS\" is enabled.\n\t// Without this rule, Windows 8.1 and newer devices issue parallel DNS requests to DNS servers\n\t// associated with all network adapters, even when \"Override local DNS\" is enabled and/or\n\t// a Mullvad exit node is being used, resulting in DNS leaks.\n\t// We began creating this rule on 2024-06-14, and this knob\n\t// allows us to disable the new behavior remotely if needed.\n\t// Set by [nodecap.DisableLocalDNSOverrideViaNRPT].\n\tDisableLocalDNSOverrideViaNRPT atomic.Bool\n\n\t// DisableCaptivePortalDetection is whether the node should not perform captive portal detection\n\t// automatically when the network state changes.\n\t// Set by [nodecap.DisableCaptivePortalDetection].\n\tDisableCaptivePortalDetection atomic.Bool\n\n\t// DisableSkipStatusQueue is whether the node should disable skipping\n\t// of queued netmap.NetworkMap between the controlclient and LocalBackend.\n\t// See tailscale/tailscale#14768.\n\t// Set by [nodecap.DisableSkipStatusQueue].\n\tDisableSkipStatusQueue atomic.Bool\n\n\t// DisableHostsFileUpdates indicates that the node's DNS manager should not create\n\t// hosts file entries when it normally would, such as when we're not the primary\n\t// resolver on Windows or when the host is domain-joined and its primary domain\n\t// takes precedence over MagicDNS. As of 2026-02-13, it is only used on Windows.\n\t// Set by [nodecap.DisableHostsFileUpdates].\n\tDisableHostsFileUpdates atomic.Bool\n\n\t// ForceRegisterMagicDNSIPv4Only is whether the node should only register\n\t// its IPv4 MagicDNS service IP and not its IPv6 one. The IPv6 one,\n\t// [tailscale.com/net/tsaddr.TailscaleServiceIPv6String], still works in either case.\n\t// This knob controls only whether we tell systemd/etc about the IPv6 one.\n\t// See https://github.com/tailscale/tailscale/issues/15404.\n\t// Set by [nodecap.ForceRegisterMagicDNSIPv4Only]\n\t// TODO(bradfitz): remove this a few releases after 2026-02-16.\n\tForceRegisterMagicDNSIPv4Only atomic.Bool\n\n\t// EmitRuntimeMetrics is whether the node should poll and emit [runtime/metrics]\n\t// as [tailscale.com/util/clientmetric]'s.\n\t// Set by [nodecap.EmitRuntimeMetrics]\n\tEmitRuntimeMetrics atomic.Bool\n\n\t// DisableUDPGRO disables UDP GRO on the magicsock UDP socket.\n\t// Set by [nodecap.DisableUDPGRO].\n\tDisableUDPGRO atomic.Bool\n\n\t// DisableUDPGSO disables UDP GSO on the magicsock UDP socket.\n\t// Set by [nodecap.DisableUDPGSO].\n\tDisableUDPGSO atomic.Bool\n\n\t// DisableTUNUDPGRO disables UDP GRO on the Tailscale TUN device.\n\t// Set by [nodecap.DisableTUNUDPGRO].\n\tDisableTUNUDPGRO atomic.Bool\n\n\t// DisableTUNTCPGRO disables TCP GRO on the Tailscale TUN device.\n\t// Set by [nodecap.DisableTUNTCPGRO].\n\tDisableTUNTCPGRO atomic.Bool\n\n\t// NeverGSOEqualTail enables a UDP GSO sentinel-tail workaround in the\n\t// underlay UDP packet TX path on Linux. Applies to magicsock and peer relay\n\t// UDP sockets.\n\t// Set by [nodecap.NeverGSOEqualTail].\n\tNeverGSOEqualTail atomic.Bool\n\n\t// CacheNetworkMaps is whether the node should persistently cache network\n\t// maps and use them to establish peer connectivity on start, if doing so\n\t// is supported by the client and storage is available.\n\t// Set by [nodecap.CacheNetworkMaps].\n\tCacheNetworkMaps atomic.Bool\n\n\t// ScopeQuad100OnMacOS lets sandboxed macOS scope quad-100 for simple DNS\n\t// configs, so public queries can use the OS resolver (including DoH).\n\t// Custom split resolvers or unrouted forward/PTR records still require\n\t// quad-100 as primary. Off by default; has no effect on other platforms.\n\t// See tailscale/corp#45534 and tailscale/corp#48693.\n\t// Set by [nodecap.ScopeQuad100OnMacOS].\n\tScopeQuad100OnMacOS atomic.Bool\n}\n```\nKnobs is the set of knobs that the control plane's coordination server can adjust at runtime.\n\n```go\nfunc (k *Knobs) AsDebugJSON() map[string]any\n```\nAsDebugJSON returns k as something that can be marshalled with json.Marshal for debug.\n\n```go\nfunc (k *Knobs) ShouldForceRegisterMagicDNSIPv4Only() bool\n```\nShouldForceRegisterMagicDNSIPv4Only reports the value of ForceRegisterMagicDNSIPv4Only, or false if k is nil.\n\n```go\nfunc (k *Knobs) UpdateFromNodeAttributes(capMap tailcfg.NodeCapMap)\n```\nUpdateFromNodeAttributes updates k (if non-nil) based on the provided self node attributes (Node.Capabilities).\n\n","path":"tailscale.com/control/controlknobs","name":"controlknobs","synopsis":"Package controlknobs contains client options configurable from control which can be turned on or off.","isRedistributable":true}
