check the string for being an IPv4 address

When we encounter a string where a json object representing a
domain is expected, check if this string looks like an IPv4
address, and return a domain object with this address.