Use net.ParseIP for IP format checking

This supports all possible formats without the need to use regular expressions.