I've been doing some reading up on this.. haven't applied for my ESTA yet but I probably will tonight (it's US$14 for each person)
You need an ESTA even if you're not stopping in the US - if that's the case on the online form when it asks for Hotel address just enter "In Transit"
Here's a couple of links you might find useful :
Visa Waiver Program passport requirements (basically unless you've got a really really old passport you'll probably be ok.. it doesn't need to be one of these new biometric passports with a chip in it etc.. but have a read of the link below)
If you meet the passport requirements then you can apply online for an ESTA and pay your US$14.
They advise at least 72 hours before flight, but you can apply any time and it normally comes back with an answer a lot quicker than 72 hours - seconds sometimes apparently, but don't bank on it.
Having an ESTA doesn't give you a visa as such, but it means they'll be able to process your application for a Visa under the Visa Waiver Program when you arrive in the US.
I'm all booked up to go, and the route I decided to take was Heathrow -> LA -> Auckland
I'm going via LA because I figured it would be easier to get an air rifle through - Dubai seems more than a little difficult when I checked. Also I figured if I do have to explain things, it's going to be much easier to explain to someone who (almost) speaks the same language as me.