Co-hosts New Zealand made it two wins from two at the World Cup, but they were made to work harder than expected for their three-wicket triumph over Scotland in Dunedin.

Trent Boult took two for 21 to be the pick of a blistering New Zealand attack, which left Scotland reeling on 12 for four early on and claimed four golden ducks.

Matt Machan (56 off 79 balls) and Richie Berrington (50 off 80 balls) helped Scotland eke out a total of 142, but the Kiwis still looked set to claim an easy win.

The Scots dug in, though, and Kane Williamson's 45-ball 38 was the top individual score for the Black Caps as they pushed hard and lost seven wickets before ultimately claiming the win with 151 balls remaining.

Hopes will remain high that Scotland can win their first-ever World Cup match at this year's tournament, but the in-form Black Caps showed early signs they were not going to be caught short at the University Oval.

The Scots, who beat Ireland and pushed West Indies close in the warm-up matches, got off to the worst possible start and slumped to 12 for four after just 4.2 overs.

New Zealand, who named an unchanged side from their opening 98-run win over Sri Lanka, won the toss and elected to field, with that decision paying immediate dividends as Boult and Tim Southee wreaked early havoc.

Boult drew first blood, claiming two wickets in two balls as Calum Macleod and Hamish Gardiner both departed for golden ducks at the start of the second over.

Not to be outdone, Southee replicated Boult's efforts two overs later as Kyle Coetzer (one) departed after finding Grant Elliott at short mid-wicket and then Scots skipper Preston Mommsen walked straight after for a first-ball duck.

A 97-run fifth-wicket partnership between Machan and Berrington steadied the ship for Scotland, but the rest of their batting order fell away as New Zealand's red-hot attack wrapped their innings up in 36.2 overs.

Machan brought up an impressive 71-ball fifty around the halfway point of Scotland's allotted overs, with Berrington smashing a six over long-on from Daniel Vettori afterwards in celebration.

But Corey Anderson ended their stand in the 28th over, as Machan (56) top-edged an attempted pull to Brendon McCullum at mid-on, and then he got Berrington out two overs later, just after the 27-year-old claimed his seventh ODI fifty to leave the Scots on 117 for six.

Anderson and Vettori then mopped up the tail between them, taking three wickets in total apiece, with Scotland's innings ending how it started as Vettori caught Iain Wardlaw in front for a golden duck. The final four wickets fell for just 25 runs.

Martin Guptill (17) was a man in a hurry as New Zealand looked to complete their chase of 143 at breakneck speed.

The Kiwi opener smashed two fours in as many overs and then found back-to-back boundaries at the start of the third over, before his ambition got the better of him and his attempted lift over long off was edged behind to Matthew Cross.

Black Caps skipper McCullum (15) walked to the same combination at the end of the seventh over as Scotland began to dig in, leaving New Zealand on 63 for two at lunch.

The expected onslaught from the co-hosts was slow in coming and Ross Taylor was out for nine in the second over after lunch, before a fourth-wicket stand of 40 from Williamson and Elliott anchored the Black Caps' innings.

Williamson (38) became the first of three Josh Davey victims in the 18th over and Elliott (29) fell soon after to leave New Zealand on 117 for five, needing 26 off 29 overs to claim the win.

With New Zealand continuing to force the issue Davey made things interesting by claiming two wickets in three balls as Anderson (seven) and Luke Ronchi (12) both fell in quick succession as the co-hosts finished the 24th over five runs short with three wickets left.

Vettori finally wrapped things up for the Black Caps in the next over as he unconvincingly top-edged through the slip region for four to take New Zealand to 146 with just over half their allotted overs remaining.

Scotland captain Preston Mommsen praised Machan and Berrington's efforts, which helped to give his side a fighting chance when they had looked doomed.

"It was a very tough start for us, obviously the ball was doing a little bit more than expected and to be fair they bowled very well and exploited the conditions," he told the post-match presentation broadcast by Sky Sports World Cup.

"Unfortunately we lost a few early ones but credit to Matthew and Richie batting through the middle there. I think they showed what we are capable of.

"Unfortunately they couldn't go on for longer and we were well below par in the target we set."

Corey Anderson singled out Boult, who will play for Sunrisers Hyderabad alongside Kevin Pietersen in the forthcoming Indian Premier League campaign, after his golden duck double at the start of the second over put Scotland in trouble.

He said: "The way Trent to me started off was unbelievable. They're classy swing bowlers and they showed it today."

New Zealand skipper Brendon McCullum was impressed by Scotland's efforts and was just relieved his side can move on with their 100 per cent start intact.

"It was tough," he said. "Credit to Scotland the way they hung in there, especially after being 12 for four.

"Lesser teams would have rolled so credit to them for the way they hung in and managed to post a total that was going to be a little bit tricky on that surface.

"Pleased with the result, it was a little bit nervous towards the end, but we'll take it."