Move code in m_dns
Don't close the DNS socket on every rehash, remove unneeded calls to shutdown()