Check string length instead of value
Don't allow IP addresses to have a prefix

This disallows things like abc.127.0.0.1, which aren't valid domains.