handling ip addresses when determining subdomain