dns: refactor dns to more modern JavaScript
Pull Request check-list
Affected core subsystem(s)
dns
Description of change
The current dns.js file contains some pretty outdated JavaScript practices - this pull request aims to improve the file and bring it up to the standard coding style the rest of the project has.
WIP: meanwhile feedback is appreciated.