A blistering start by Rotherham saw them comfortably dispose of Dagenham, taking them level on points with table-topping Morecambe.
Having gone close three times in the first five minutes, Gareth Evans gave them the lead when he converted Marcus Marshall's cross.
Scott Doe equalised from Gavin Tomlin's corner but Lewis Grabban restored the lead with a header.
Grabban hit his second when he latched on to Evans' cross.
VIEWS FROM THE DRESSING ROOM
Rotherham boss Andy Scott told BBC Radio Sheffield:
"It was a 35 minute performance and fortunately it got us through.
"It's not good enough and I'm not happy with it and I have let the players know that.
"Standards have to be better then that, much better and we're better then that as players."