The 53-year-old is happy at Paris Saint-Germain but could be tempted to make the move to the Santiago Bernabeu side if the opportunity arises
The Italian coach has been touted as a possible replacement for Jose Mourinho, who is set to leave Madrid for Chelsea at the end of the season, and the 53-year-old has revealed that he was already close to the Blancos job once before.
"It would be pretty hard to reject Madrid," Ancelotti told Sky.
"I do not know whether my future lies at Real Madrid. There was a moment in the past when I was close to Madrid, but I eventually joined Chelsea instead.
"Nobody knows what will happen in the future, but I am happy at PSG and could stay here for a long time. I am enjoying life in Paris. I want to win Ligue 1 and celebrate the title."
Ancelotti joined PSG in December 2011 and guided them to the quarter-finals of the Champions League this term, while they are on the verge of wrapping up their first Ligue 1 title since 1994.