What is the origin of the phrase “hunky dory”?
There's no agreed derivation of the expression 'hunky-dory'.
It is American and the earliest example of it in print that I have found is from a collection of US songs, George Christy's Essence of Old Kentucky, 1862.
We do know that 'hunky-dory' wasn't conjured from nowhere but was preceded by earlier words, i.e. 'hunkey', meaning 'fit and healthy' and 'hunkum-bunkum', which had the same meaning as 'hunky-dory'. 'Hunkey' was in use in the USA by 1861, when it was used in the title of the Civil War song A Hunkey Boy Is Yankee Doodle. 'Hunkum-bunkum' is first recorded in the US sporting newspaper The Spirit of The Times, November 1842.
They both cite the Japanese road theory, the Word Detective then adds:
The least exotic theory of all, but almost certainly the true clue, traces "hunky-dory" to the archaic American slang word "hunk," meaning "safe," from the Dutch word "honk," meaning "goal," or "home" in a game. To achieve "hunk" or "hunky" in a child's game was to make it "home" and win the game.
The question of where the "dory" came from brings us back to our old friend "O.K." Children very often do not just say "O.K." -- they say "okey-dokey," thus engaging in what linguists call "reduplication," or the emphatic, joking repetition of parts of a word. "Hunky- dory" is almost certainly a similar product of reduplication by children who had won their game.
And Michael Quinion adds:
It may be that hunky-dory was the result of a bilingual pun, perhaps invented because American sailors knew the word dori and prefixed it with hunky as an imagined Japanese street of earthly delights.
My favourite quote is from the Word Detective:
It's an entertaining theory, but like most entertaining theories about word origins, lacks supporting evidence.
The earliest I found is in the 1866 book Tony Pastor's Waterfall Songster: A Splendid Collection of the Newest Comic Songs, Written and Sung by the Renowned Comic Vocalist, Tony Pastor, at his Celebrated Opera House, in a song called "Hunkydory":
It's the second song in the book after the eponymous "Waterfall Song", so perhaps it was a popular one.
Gary Martin of The Phrase Finder found the same song (with almost identical words and to the same tune) four years earlier:
It is American and the earliest example of it in print that I have found is from a collection of US songs, George Christy's Essence of Old Kentucky, 1862:
As sung by Christy's Minstrels.
Air - "Limerick Races"
One of the boys am I,
That always am in clover;
With spirits light and high,
'Tis well I'm known all over.
I am always to be found,
A singing in my glory;
With your smiling faces round,
'Tis then I'm hunkey dorey.
Martin found some other 1866 quotations:
Not long afterward, in October 1866, the US magazine The Galaxy, seemed unclear why the phrase was used, which also indicates that it wasn't very long in the tooth at that date:
"I cannot conceive on any theory of etymology that I ever studied why anything that is 'hunkee doree', or 'hefty' or 'kindy dusty' should be so admirable."
That citation does at least suggest that 'hunky-dory' was in common enough use in 1866 for the author not to see fit to explain its meaning, although it's a pity 'hefty' and 'kindy dusty' weren't explained as these have now disappeared from the language. It seems that The Galaxy writer had been perplexed by the recent popularity of the the expression, which appears in several publications in 1866; for example, The Galveston Daily News, June 1866, had this piece of advice:
In the morning wash with Castile soap, in soft rain water, and you are all "Hunky-dore" - as fresh as a lily - as sweet as a pink.
I found some 1880s snippets that offer explanations. First, Library of Universal Knowledge, Volume 1 (1880):
Hunk, a large piece; "all hunky," all right; also "hunky dory."
Hunky dory isn't in the OED, but this US slang meaning of the hunky is, the noun dating from 1861 ("he was ‘a hunkey boy’"), with similar hunk from 1856 "Now he felt himself all hunk").
Second and less believable, Cruise of the revenue steamer Corwin in Alaska and the N. W. Arctic ocean in 1881 ...: Notes and memoranda ... (1883):
Persons fond of tracing resemblances may find in "Ignik" (fire) a similarity to the Latin ignis or the English "ignite," and from " Un-gi-doo-ruk" (big, huge) the transition down to " hunky-dory" is easy.
1866, Amer.Eng. (popularized c.1870 by a Christy Minstrel song), perhaps a reduplication of hunkey "all right, satisfactory" (1861), from hunk "in a safe position" (1847) New York City slang, from Du. honk "goal, home," from M.Du. honc "place of refuge, hiding place." A theory from 1876, however, traces it to Honcho dori, said to be a street in Yokohama, Japan, where sailors went for diversions of the sort sailors enjoy.
But that's pretty nebulous.
Edit: I'll add that I don't see how you'd get hunky-dory from Honcho Dori, which would be pronounced something like "HOE-NN-CHO DOE-(d)EE" ( the (d) representing a soft vocalized tongue tap).
Here's what I found in a New York State newspaper from 1870:
The slang expression of hunky dory is Scotch, and is a synonym of the Latin "non compos." He is "unco dour in the uptak," is the full expression.
Google translates "non compos" as "not in control" but its translation of the full expression leaves much to the imagination: "Dover hook on the uptake." Origin in post-Civil War time seems to be realistic.
Derived from the Latin, "Hunkous Dorius" who was known for his fair disposition said to arise from his parentage, his father being an owl and his mother, Sensoua, the step-sister of the goddess Venus.
Hunkous Dorius, was the hero of a number of stories, he was said to be a teacher, a sailor and an athlete of tremendous prowess. When the Discus was thrown properly, sometimes a shout or cry of "Hunky Dory" would be heard, as an exclamation as to the righteousness of the throw.
To this day its usage remains a positive statement of the current state of affairs and is frequently used in programming androids and bio-forms to provide a positive null state for default programming functions and indicates a properly working programming state with all basic variable defined and ready to populate with proper values.