Since the function is linear, we can do the following:
Plug in y=2 into the equation
2 = x+6
Subtract both sides by 6
x = -4
Plug in y=4 into the equation
4 = x+6
Subtract both sides by 6
x= -2
The domain of the function is {-4, -2}
Have an awesome day! :)