In gay slang, a "friend of Dorothy" (occasionally abbreviated FOD) is a term for a gay man. The phrase dates back to at least World War II, when homosexual acts were illegal in the United States. Stating that, or asking if, someone was a "friend of Dorothy" was a euphemism used for discussing sexual orientation without others knowing its meaning. A similar term, "friend of Mrs. King" (i.e. Queen) was used in England, mostly in the first half of the 20th century.
The precise origin of the term is unknown. Some believe that it is derived from The Road To Oz (1909), a sequel to the original Wonderful Wizard of Oz. The book introduces readers to Polychrome who, upon meeting Dorothy's traveling companions, exclaims, "You have some queer friends, Dorothy", and she replies, "The queerness doesn't matter, so long as they're friends." More commonly, it is stated that "friend of Dorothy" refers to the film The Wizard of Oz because Judy Garland, who starred as the main character Dorothy, is a gay icon. In the film, Dorothy is accepting of those who are different. For example, the "gentle lion" living a lie, "I'm afraid there's no denyin', I'm just a dandy lion."
In many of the original Oz books there are some LGBT friendly plots. In the first book Dorothy admits to a crush on the China Princess. Ozma was transformed into a boy and her memories erased for most of her life. An all female army attempted to conquer Oz. Ozma essentially marries Dorothy in book six making her a princess of Oz and her longtime companion. There are several creatures, including air elementals and some sorceresses which appear only in female groups. Glinda, the good witch, lives in a castle along with 100 of the most beautiful women in Oz who greet Dorothy and Ozma when they visit with kisses and dance for their amusement.
In the early 1980s, the Naval Investigative Service was investigating homosexuality in the Chicago area. Agents discovered that gay men sometimes referred to themselves as "friends of Dorothy." Unaware of the historical meaning of the term, the NIS believed that there actually was some woman named Dorothy at the center of a massive ring of homosexual military personnel, so they launched an enormous and futile hunt for the elusive "Dorothy," hoping to find her and convince her to reveal the names of gay service members.