As in the title "White to move and mate in 2 moves"
It means that white mate in two moves against any defence played by black.
In your example the move 1.Qb1 doesn't solve the problem because, as you explained, black can play 1...Nf6 and then it is impossible for white to mate in his second move.
There is other move, that allow white to mate in 2 moves no matter what black play in reply.
White to move and mate in 2 moves
Composed by Valentin Marin y Llovet (Spain)
Published in Deutsche Schachzeitung 1906
Theme: Flight giving key