Validate IP addresses before use.