See this thread:
http://www.bay12forums.com/smf/index.php?topic=95811The most reliable method seems to be to build a completely above-ground cistern and use a pump or two to pump water into it.
A bit more details on the theory. Saltiness is a property of location. Individual tiles on the map are flagged as salty or not salty. In the ocean, water near the surface (sometimes including murky pools and aquifers) are flagged as salty from the start. If two tiles both have water in them, and one is salty, the other will become salty. This means that if any part of a body of water becomes salty, the entire thing will become salty.
There does not appear to be any way, short of memory hacking tools, to turn a salty tile back to being non-salty. So if a cistern has every contained salt water, any water ever placed in that cistern will be salty.
Pumps don't so much remove salt as teleport water. Water is removed from the entrance tile of the pump and created at the exit tile of the pump. If the entrance tile was salty and the exit tile was not salty, then the pump is effectively desalinating the water. You can use this to make fresh water at the ocean, provided you are very, very careful never to let the fresh water at the output touch any salt water.
Oceans generate waves, which can travel quite far inland. These can apparently turn fresh water salty, if the water is at the level of the ocean and the wave travels across it. This can apparently happen even if there is a solid wall in the path the wave. So the most reliable desalination systems are those where none of the desalinated water is at the same Z-level as the surface of the ocean.