The dam problem in unbounded domains