The domain is the horizonal extent of the function definition. Here, the function is defined between x=-6 and -1, and between x=1 and 5, including x=-1 and x=5.
The only answer choice that shows the domain correctly, (-6, -1] ∪ (1, 5], also shows the range correctly. The second choice is the appropriate one.