Deep Space Nine was constructed by the Cardassians during their occupation of Bajor to exploit the planet for mining purposes. Gul Dukat was the commanding officer of the station up until the Cardassians retreated from Bajor. It was called Terak Nor by the Cardassians during the occupation as well as when they recaptured the station during the Dominion War. The station was later recovered by the Federation. Remember, all of this is part of Gene Roddenberry's fictional Universe.