What is the best way to capture the moon with a city background? The moon is so bright that if I do long exposure to capture the city, the moon will be completely blown out into a white star. Is HDR the only way?
This is the same as any photo where one part is way brighter than the other:
Graduated ND filter (only relevant if all the buildings are below the moon and you don't care about the exposure of the sky)
Take two photos and combine them manually (pretty easy in your case because you just have to copy-paste the moon between photos)
Personally, since the shot is probably going to be long exposure and doesn't move. I'd do two exposures and blend them together in post. It'll be the easiest and cheapest approach.
HDR could work, but getting the spread correct would be difficult and is overkill for your needs.
Graduated ND filters are great in situations where the bright part is going to cause bleed in to the darker portion of the image or you need to take a quick shot because there is motion you need to stop, but they are a reasonably expensive specialty item.
If you simply setup a tripod, take one photo of the moon and one photo of the skyline properly exposed, then you can overlap them in Photoshop and simply mask one on to the other. The night sky should allow for a pretty smooth gradient to be applied to blend the background or you can do it directly along the skyline if you prefer. You could also try an additive blend after removing the overexposed moon from the skyline shot.
Shoot shortly after sunset when dusk is still bright enough to keep the cityscape within reach of your camera's dynamic range compared to the sunlit moon. This also helps to keep from blowing out the colored lights in the city skyline that have just come on. When you properly expose for the moon, the landscape will appear much darker in your photograph than it does to your eyes. The resulting photo will look like it was shot with much darker skies than it actually was.
The brightness of the sky and the landscape/cityscape it is illuminating changes rapidly around sunset. A difference of only as much as 30-90 seconds can make a world of difference in the comparative brightness of the sky, moon, and cityscape! Set up during daylight, set exposure manually for the moon to be just below over exposure, and start shooting as soon as the city lights come on. Ten or fifteen minutes later it will be all over but the crying.
You might want to consider a Graduated ND filter. A graduated ND filter darkens the top half of the frame, allowing you to use a longer exposure than would otherwise be possible.