Sentence: "There was some doubt as to who the child's real father was."
I have a feeling I should use whom instead: "There was some doubt as to whom the child's real father was."
What is the correct one? How to know which of these two pronouns to use in this sentence?