Bring back a much simplified version of our dns resolver.

The experiments with a custom nginx plugin to do this directly inside
nginx still have some issues (segfaults when combined with keepalive).
So for now, we'll go back to a greatly simplified version of our IP
address resolver that resolves the domain names externally, writes a new
nginx config file with only IP addresses, and reloads nginx on changes.
Now that we can reload the router nginx instance separately, we can be
much more aggressive in reloading nginx when changes are detected, so we
can get rid of most of the weird old logic that tried to minimize
reloads. This means we now basically adhere to the TTLs returned for
each domain name (there's a configurable minimum TTL which defaults to
40 seconds).