Add support for IPv6 addresses in --dns parameters.

Replace #6408
@vieux Could you change this to `ValidateIP`, please?