Goals from Gino Padula and Kevin McLeod took QPR through despite the Daggers' late rally.
The visitors' former QPR winger Tony Scully netted a late goal against his old club, but it was not enough to stop the R's reaching the third round.
Rangers went ahead with a fortuitous goal seven minutes before half time.
Danny Hill seemed to get a touch to a left-wing corner before the ball crossed the line.
The goal came after the Conference side had worried Rangers in the opening stages.
It took a well-timed challenge from Terrell Forbes to stop Paul Bruce - another ex QPR man - from capitalising after a poor clearance by keeper Nicky Culkin. Minutes later, Scully fired wide after being set up by Leon Braithwaite.
Dagenham continued to make a fight of it in the second half and sub Alan Kimble saw his free-kick tipped away by Culkin, who also saved from Scully following a mistake by centre-back Clarke Carlisle.
But if Rangers' opening goal was slightly lucky, their second was the result of a moment of pure class. Gareth Ainsworth teed up McLeod with a reverse pass and the former Everton man made no mistake, slotting the ball beyond Tony Roberts and into the corner of the net.
Roberts was playing against the club he spent 11 years at as a player and where he is still involved in a coaching capacity.
Richard Pacquette headed Padula's corner wide, before Dagenham were given hope when Mark Bentley crossed from the right for Scully to score at the far post.
Culkin saved an effort from Brathwaite as Rangers were given a scare at the death, but the home side managed to hang on.