Post History
Read literature from the country or period you want to write about. If you want to write about norse mythology, open the Edda and get names there. If you want to write about the french revolution...
Answer
#3: Attribution notice added
Source: https://writers.stackexchange.com/a/31641 License name: CC BY-SA 3.0 License URL: https://creativecommons.org/licenses/by-sa/3.0/
#2: Initial revision
Read literature from the country or period you want to write about. If you want to write about norse mythology, open the Edda and get names there. If you want to write about the french revolution, open Diderot and find names there. And so on. Read history, read sagas, read original literature. There is your source. If you want to write about a fantasy world, which is inspired by some historical period, it's a bit more tricky than that. You can still use existing names from inspiring works (for instance, all the dwarves in "The Hobbit" take their names from characters from the norse Edda. "Gandalf" comes from there too. And no, they are not copyrighted). But if you want your fantasy world to be more original, you need to work on your world building and decide some linguistic rules, so that your names are consistent with that. This is probably what doesn't work with random generators: they are not based on a language-world. Adherence to a true language is what makes names be meaningful: this is all which Tolkien's work is based upon. (On a personal note, I strongly believe that fantasy is based on language mostly). A final additional hint: if you want to write about a contemporary world, just watch the ending credits of a movie, and pick a random guy from there.