Dynamic metasurface antennas (DMAs) have great potential to be used in the radiator/receptor elements of future wireless transmitters and receivers, replacing conventional metallic antennas. This can be attributed to their unique properties, such as the ability to be reconfigured in real-time and to reduce the radio frequency chains, resulting in low implementation cost. However, the Lorentzian constraint associated with the DMA elements poses a challenge to real-time configuration and limits the application of the DMA. In this study, we propose a DMA-based wireless network, wherein a DMA-equipped base station (BS) communicates with single and multiple users. For the single-user scenario, we develop an optimal algorithm to maximize the signal-to-noise ratio of the user, which provides the weight of each DMA element in closed form. Furthermore, for multiple users, we formulate the weighted sum rate (WSR) problem and employ techniques from the single-user case to develop an efficient alternating optimization algorithm, which optimizes both the transmit precoders and DMA weights, to enhance the WSR of the system under the transmit power constraint of the BS. The numerical results demonstrate the effectiveness of the proposed algorithms in achieving better performance than that of the benchmark schemes.