The domain for this function is restricted because you may not divide by zero. All real values of x except those that create division by zero situations are legal. The offending values of x are -2 and 0, so that is why the domain is as you have stated.