It should be set in camera (on my phone so can't see your camera model).
EDIT: just checked and you have a D5100....
Taken from Unkle Ken's site:
shot.
"Hold down the flash icon button on the side of the camera and spin the rear dial to select the flash sync mode. The sync mode is displayed on the lower left of the rear LCD.
Here are the flash modes and what they do:
Normal (a lightning bolt, which is the default):
In Program and A exposure modes, the shutter won't stay open longer than 1/60 second.
I always use Normal mode and it looks great.
In this mode you won't get blur indoors, but you may get black backgrounds. The best way to avoid dark backgrounds with the D5100 is to use an external flash like the SB-400 and bounce it off the ceiling (flip it up). I love the look of the bounced SB-400 external flash; you can see a zillion examples at my baby Ryan Rockwell's website.
Unlike other Nikons, the D5100 doesn't have a custom function to choose a longer speed, like 1/8, in P and A exposure modes to lighten backgrounds indoors. You'll have to use S or M mode which takes more work to setup. You can use the Slow Sync mode below, but indoors or at night it often results in foolishly long speeds of up to 30 seconds, which lead to blur.
Red-Eye (bolt and eyeball icon)
I never use this.
It shines an obnoxious light in your subject's eyes for a couple of seconds and then releases the shutter.
If I set this mode by accident it bugs the heck out of me, because the camera doesn't go off until several seconds after I've pressed the shutter, but I have no idea why because I've set no self timer!
It doesn't do much to reduce redeye anyway. Skip this mode.
Red-Eye SLOW (bolt, eye and SLOW icon)
This is the SLOW mode and redeye. I don't use it for the same reason I don't use Redeye.
SLOW (bolt and SLOW icon)
SLOW unlocks the camera in P and A exposure modes to allow it to make exposures as long as it wants to in dim light. This way the backgrounds look natural instead of inky black.
This mode can be very useful. It lets the shutter stay open as long as it needs to so dim ambient light can expose properly with flash. Of course if it's dark these exposure times can get long. You can get blur from subject motion and camera shake.
In daylight, exposure times are less than 1/60 of a second anyway, so SLOW does the same thing as NORMAL.
Most issues of National Geographic show many indoor shots made in this mode. The background exposes correctly, people may be blurred, and a burst of flash freezes them along with the blurry ghost images.
Normal and SLOW do the same thing in S and M exposure modes,since you or the camera may select any shutter speed in these modes regardless of flash sync.
I usually prefer to choose an exact slowest shutter speed in the M or S exposure modes,because the SLOW flash mode in P or A exposure modes can allow shutter speeds to become too long for comfort.
REAR (bolt and REAR icon)
Normally the flash goes off the instant the shutter opens. With long exposures and blurred ghost images you ordinarily get the ghost streaming out in front of the subject. Think about it: if a car is driving, the flash goers off and freezes it, then the car moves forward. You'll have a ghost image ahead of the car, which usually looks stupid.
Select REAR mode to have the flash go off instead when the shutter closes. Now you'll have motion blurring behind the frozen flash image.
REAR doesn't do anything noticeably different with short exposures."