An exercise given to me a long time ago that helped tremendously at getting a mental model of the fretboard goes like this:
This is less tedious if you have some kind of play-along thing like iRealB that can make a background accompaniment for you. I probably have mp3s of it somewhere.
Starting with C major, we are going to play the scale ascending and descending. You're going to use the generic scale shape that starts with the second finger, but for the time being you are limited to starting and ending on the E string. So find C on the E string, put finger 2 there, and play the scale up and down.
Next you're going to move counter-clockwise on the cycle of fifths one position, F major. You're going to pick one of the Fs on the E string, move finger 2 there, play up and down the scale.
Repeat this process until you get back to C major again. The only other rule is that you don't start on an open string, so when you get to E you're going to play it at the twelfth fret.
Once you're through the cycle, do the same thing but starting on the A string. The do the same on the D string, but you'll be leading with your pinky and descend rather than ascend first. And so on for the G string.
Then do the same thing for the minor scale in all 12 keys, if you get bored of scales play the major and minor arpeggios, etc. It's important to do it with a metronome; the goal here is that, while you are playing a given scale, you need to think about what the next key in the cycle is and where it lays on the string. You can start by giving yourself 4 bars to go up and down, then as you get faster, do it double time in 2 bars. I think its probably ideal to start at a tempo where you are screwing up pretty often, and then increase the tempo pretty aggressively so that you are screwing up again, since the training is most effective when you are operating at your limit.
Its also best to have the backing chords, so that when you miss a shift, you want to force yourself to catch up to the train as it visits each key, rather than to pause and think about what to do since the goal is to train yourself to find these positions without having to think about it.
In practice, you will wind up spending a lot of time between the fifth and twelfth frets, which is sort of a no-man's land for a lot of players. Playing above the twelfth fret is comparatively trivial since its just a mirror of the bottom position.
Anyway hope that helps, I've used it with pretty much every student I've ever worked with and always found it to be effective. Plus if you haven't memorized the cycle of fifths you get that for free with this exercise.