dns: resolver: validate arguments

Mitigates C++-land assertion error when unchecked arguments are delegated; adds tests accordingly. Closes #7070 ("DNS — Throw meaningful error(s)").