The meaning of Do you know X? is inherently ambiguous / imprecise. It could mean Are you aware that X exists?, OR Are you [very] knowledgeable about X? ("Are you personally acquainted?" if X is a person, "Do you fully understand?" if X is a concept, etc.).
So even native speakers are sometimes unsure about exactly what they're being asked (but usually the context gives sufficient clues). It might seem a bit odd to a non-native speaker, but the following conversation is actually perfectly credible...
A: You know the capital of Japan? I hear the mayor is planning to build a spaceport in the city centre!
B: Yeah, I read about that. I can't remember the name of the Japanese capital though. Do you know it?
A: No, I don't know the actual name. Didn't it used to be called Saigon, or something like that?
B: Maybe. But they might have changed the name to Peking after the war.
...where A's first sentence simply means something along the lines of I'm sure you're aware that Japan has a capital city. Focus on that, because I'm going to say something about it. But obviously neither A nor B know much at all about the capital of Japan - not even the name (all they know is it's planning a spaceport).
In practice, OP's first (shorter) version is a far more common way of asking whether someone knows the name of something. If the questioner wanted to ask whether the addressee was intimately familiar with the capital of Japan (through having spent some time visiting / living in Tokyo), he could unambiguously indicate that by asking Do you really know the capital of Japan?
Thus broadly speaking,...
1: Do you know the capital of Japan?
...might mean anything from...
1a: The capital of Japan is the focus of my next statement (but it's irrelevant whether you know its name)
...through...
1b: Do you know the name of the capital of Japan?
...to...
1c: Do you know [in detail] what the capital of Japan is like?