Major Scale Shapes
CAGED System

D form

G major scale, based around the D chord form

Moving up the neck to the 5th fret, is the next scale form. These are all the same notes as the previous form, just in a different place on the neck. As you can see there are actually 2 different fingerings in this position. You are either going to shift down 1 fret for the 4th and 3rd strings, or stretch with your 4th finger and grab those same notes on the 5th and 4th strings.

This scale form is sometimes referred to as the Dorian scale form. If you thought of the first note that you played (A) as the root, this would be the mode A Dorian. Modes are a whole other topic, so don't worry if you don't really understand what that means at the moment. It is just another name for you to refer to this particular scale fingering as.

G      

This is a movable major chord shape, based on an open D. Played at the 5th fret this is a G chord. Keep in mind that there is a difference between being based on a particular chord shape, and the actual chord sound.
This scale form is built around this movable major chord shape, and is sometimes referred to as the D form (CAGE D) of the major scale. It is not a D major scale, It is a G major scale based around the basic D major chord shape.

Down the neck to the E form

Up the neck to the C form