The long-wavelength optical phonons and dielectric constants of PLD-grown MgxZn1-xO films are studied by combination of infrared spectroscopic ellipsometry and Raman scattering spectroscopy. The ternary alloy MgxZn1-xO exhibits a phase transition with change of coordination number from four-fold coordinated, hexagonal wurtzite structure (ZnO) to six-fold coordinated, cubic rocksalt structure (MgO). It is found that both phonon mode frequencies and dielectric constants change abruptly upon phase transition, which is assigned to the change of coordination number. The change of dielectric constants can be related to the change of electronic properties, for instance, the exciton binding energy. In a simple approach, the exciton binding energy depends on the reduced exciton mass and the static dielectric constant. By comparison with experimental values of the exciton binding energies it is found that the reduced exciton mass must increase by a factor of about two upon face transition from wurtzite to rocksalt structure.