code: func (d *DNSServer) toggleRecursorHandlerFromConfig(cfg *dnsConfig) {
  	shouldEnable := len(cfg.Recursors) > 0
  
  	if shouldEnable && atomic.CompareAndSwapUint32(&d.recursorEnabled, 0, 1) {
  		d.mux.HandleFunc(".", d.handleRecurse)
  		d.logger.Println("[DEBUG] dns: recursor enabled")
  		return
  	}
  
  	if !shouldEnable && atomic.CompareAndSwapUint32(&d.recursorEnabled, 1, 0) {
  		d.mux.HandleRemove(".")
  		d.logger.Println("[DEBUG] dns: recursor disabled")
  		return
  	}
  }
docs: // toggleRecursorHandlerFromConfig enables or disables the recursor handler based on config idempotently