This commit adds the ability to start `ctrld` without config file. All
necessary information can be provided via command line flags, either in
base64 encoded config or launch arguments.
This commit adds config params to enable local DNS response caching and
control its behavior, allow tweaking the cache size, ttl override and
serving stale response.
Previously, for each DoH query, we use the net/http default transport
with DialContext function re-assigned. This has some problems:
- The first query to server will be slow.
- Using the default transport for all upstreams can have race condition
in case of multiple queries to multiple DoH upstreams
This commit fixes those issues, by initializing a separate transport for
each DoH upstream, the warming up the transport by doing a test query.
Later queries can take the advantage and re-use the connection.