Pinching antennas, implemented by applying small dielectric particles on a waveguide, have emerged as a promising flexible-antenna technology ideal for next-generation wireless communications systems. Unlike conventional flexible-antenna systems, pinching antennas offer the advantage of creating line-of-sight links by enabling antennas to be activated on the waveguide at a location close to the user. This paper investigates a typical two-user non-orthogonal multiple access (NOMA) downlink scenario, where multiple pinching antennas are activated on a single dielectric waveguide to assist NOMA transmission. We formulate the problem of maximizing the data rate of one user subject to the quality-of-service requirement of the other user by jointly optimizing the antenna locations and power allocation coefficients. The formulated problem is nonconvex and difficult to solve due to the impact of antenna locations on large-scale path loss and two types of phase shifts, namely in-waveguide phase shifts and free space propagation phase shifts. To this end, we propose an iterative algorithm based on block coordinate descent and successive convex approximation techniques. Moreover, we consider the special case with a single pinching antenna, which is a simplified version of the multi-antenna case. Although the formulated problem is still nonconvex, by using the inherent features of the formulated problem, we derive the global optimal solution in closed-form, which offers important insights on the performance of pinching-antenna systems. Simulation results demonstrate that the pinching-antenna system significantly outperforms conventional fixed-position antenna systems, and the proposed algorithm achieves performance comparable to the computationally intensive exhaustive search based approach.