The first sentence is correct and usual.
The second is disputable. I would not use it.
However you could use "under the name [of] John Doe" in other contexts: He may be listed under the name John Doe.
Perhaps he registered under the name John Doe. I've searched for him under the name John Doe.
Maybe, but preferably not:
* I knew her under her maiden name. [by] *He's known in prison under his alias, John Doe. [by] *I know him under his other name. [by]
And definitely not: *Do you call him underthe name John Doe? [by]