Teach query_one and query_all to obey the IPv4 and IPv6 flags.