The best way to learn all the notes, in my opinion, is to start learning the scales and modes and their root notes.
First, learn the C major scale in every position on the fret board. Not only will you learn the scale, you'll learn the locations of every C note on the fretboard. Do this again for the G major and D major scales, and you should be able to fill in the spaces between G, C, and D anywhere on the board.