dns.cpp dns.hpp: add doxygen comments

Requested by @hellais.
Factor check_connectivity.{c,h}pp from test/net/dns.cpp

Requested by @hellais.