Farnham's Freehold is a science fiction tale set in the near future by Robert Heinlein. It was published in 1965. It is a post-apocalyptic tale, as the setup for the story is a direct hit by an nuclear weapon sends a blast shelter containing a man, his wife, son, daughter, daughter's friend, and domestic servant into the far distant future.
The book is popular with survivalist groups as it combines the civil engineering and physics of fallout shelter survival with the social dynamics of "lifeboat rules," or autocratic authority under extreme conditions, a theme further explored in depth in The Number of the Beast. To paraphrase Mr. Farnham, "How do you know who is the officer in the lifeboat? The one with the gun."
As the novel develops the family finds themselves marooned in a far future where a decadent but technologically advanced black culture keeps either uneducated or castrated whites as slaves. Each of the characters adapts to the sudden role-reversal in different and sometimes shocking ways.
Some people view both Farnham's Freehold and Sixth Column, another novel by Heinlein, as proof that Heinlein is a racist. A more accurate statement would be that Heinlein made strong philosophical points about racism in these two works, and that some people who disagree resort to attacking the author's reputation rather than answering his arguments.