How to NetworkManager, resolvconf, and dsnmasq work together?

Running Kubuntu 16.04

Sometimes the name resolution gets slow. In previous Ubuntu versions, the problem was usually in resolv.conf and was easy to fix. In 16.04 all the DNS resolution is hidden in a NetworkManager+resolvconf+dsnmasq maze, and I don’t know how I can figure out the actual DNS (dig says it’s 127.0.1.1).

Could a kind soul explain:

  1. how NetworkManager, resolvconf, and dsnmasq work together (because this is something that is not explained in the documentation of each)
  2. how can I debug DNS performance problems