The kidneys play an important role in water homeostasis. Water is mainly resorbed in the proximal convoluted tubule and loop of Henle, but fine adjustments are made in the distal tubule under the influence of antidiuretic hormone (ADH).
For instance, water is lost by the body in hot weather in sweat. This triggers the release of ADH into the blood which acts on the cells of the distal tubule and collecting duct to increase water resorption thus reducing the amount excreted. You might notice that in hot weather, you only produce small volumes of urine as the body is fighting to conserve water.
If water is in excess, ADH levels are reduced limiting the amount of water resorbed back into the blood but increasing the volume eliminated in the urine. If you drink a pint or so of fluid you will notice that within an hour your urine volume will increase and the excess water will therefore be eliminated.