From Zelda Legends Wiki
After meeting Zelda for the first time in Ocarina of Time, she tells Link her attendant, Impa, who will escort him out. Before she does, however, Impa teaches you Zelda's Lullaby, a song she says she used to serenade baby Zelda to sleep. By using this song, Link certifies himself as the messenger of the Royal Familly, letting him pass into many areas he could not otherwise (For example, Darunia's Chamber, or Zora's Domain). The song also has the mysical power to repair damaged sign posts.