Add support for IPv6 addresses in --dns parameters.

Replace #6408