Star Trek The Original Series S03 E08 – The World Is Hollow & I Have Touched The Sky
As McCoy discovers he is dying of an incurable disease, the crew of the Enterprise rush to stop an asteroid from colliding with a Federation world, only to discover that the asteroid is, in fact, a disguised alien vessel. They find an entire civilization living in the ship who believe they are actually on a planet and a dictatorial “Oracle” who forbids any attempt to discover the truth.