The moon is properly exposed at about EV 14 when it is more than 20° or so above the horizon. The rest of the landscape of a night-time scene is probably properly exposed anywhere from about EV0 to EV-3! That's a minimum of 14 stops and more likely 16-17 stops! No camera can realistically capture details of both at the same time.
So you have to cheat!
One trick with the moon is to shoot it during daylight hours or shortly after the beginning of dusk, but underexpose the shot (or reduce exposure in post processing) and adjust white balance so that it appears to be nighttime. When the moon is properly exposed, the sky and foreground will look much darker in your photograph than you perceive with your eyes.
If you want a fuller moon you need to shoot it during daylight hours or very shortly after sunset during early twilight and expose for the surface of the moon. This will underexpose the surrounding sky. The following image was shot about two minutes before sunset. The moon was about two days away from being full and had risen about an hour and forty-five minutes earlier.

The ratio of the amount of light from the moon and the surrounding sky changes rapidly during the hour or so before sunrise and the hour or so after sunset. Taking an image using the same settings and framing just a few seconds apart can alter the results significantly.
Set up during daylight, set exposure manually for the moon to be just below over exposure, and start shooting as soon as the lights come on in the foreground. Ten or fifteen minutes later it will be all over but the crying.
Another trick is to wait until a new moon and expose so that the Moon, lit by "Earthshine" appears to be lit by the sun. This will allow the surrounding landscape to be much brighter than when exposing for an illuminated moon. In this case, the sky will look much brighter than what it actually is when you shoot it.
A moon just a little past new can be shot shortly after sunset and exposed so that details are visible from the earthshine reflecting from the dark part of the new moon. Shooting an almost new moon just before sunrise also allows the same exposure. You can even capture a few bright stars and maybe a planet or comet all in the same frame. The following is a single exposure with only global adjustments made to the RAW file. It was shot around two days after the new moon at about 50 minutes after sunset right at the end of nautical twilight.
