dsdb: make get_parsed_dns_trusted() a common helper function