Ronaldo was presented with a great chance to open the scoring after collecting a pass from Toni Kroos, but his effort flew just wide of the post.
The Portuguese, who had scored in his last five matches against Levante, looked in ominous mood throughout the half and again came close after arrowing a shot wide of the net.
Victor Casadesus, operating as a lone striker for the hosts, struggled to get on the ball as Madrid played possession football in the opening exchanges.
Los Blancos were eventually awarded a penalty after Hernandez was tripped in the box by Juanfran.
Ronaldo stepped up and thumped the spot kick into the back of the net to put his side in the lead.
Hernandez made it two for Madrid, however, after James Rodriguez delivered an inviting cross onto the head of the Mexican, who could not miss from close range.