Can staying hydrated help alleviate headache symptoms, and how much water should you drink?

Can staying hydrated help alleviate headache symptoms, and how much water should you drink?