add ip6 support.

note that since ip6 addresses using :, you have to split with limit 1 to avoid everything going wrong.