The Croatia international has been linked with a sensational reunion with the Champions League-winning trainer, but insists he will not be moving away from Spain
Modric's contract expires in 2018 and has been linked with a move to Bayern, who will be coached by former Madrid boss Ancelotti from the end of the season following Pep Guardiola's planned departure.
But the Croatia international dismissed the idea of leaving Madrid, instead talking up the prospect of emulating current Madrid coach Zinedine Zidane by retiring at the club.
"I've seen that [Bayern link] mentioned in the press but it's only a rumour," he told Sportske Novosti.
"The whole squad had a really good relationship with Ancelotti. I'm still in touch with him but there has been no talk whatsoever of a move to Bayern.
READ MORE | Zidane dismayed by 'absurd' transfer ban
"My idea is to remain at the club until my contract expires in 2018. All my future plans are related to Real Madrid and there are no other clubs on my mind. I'm so happy here along with my family.
"Few players have ended their career here, Zidane being one of the exceptions. I'd like to be one of those players too, but time will tell what the future holds."
Zidane was handed the reins at Madrid after Rafael Benitez's exit earlier this month - the Frenchman tasked with resurrecting the club's La Liga title hopes.
Modric was among those said to be unhappy with Benitez's methods during a difficult seven-month spell but the 30-year-old has suggested his team-mates have struggled for fitness at times this season.
"We failed to secure the results that were expected of us," he added. "Each person will have their own particular viewpoint on the results but I feel that physically we weren't in good shape.
"Our pre-season tour of China and Australia was too quick. We spent more time in the air than we did training. This is a problem as it later impacts when the season starts.
"There was a level of mutual respect [with Benitez] and we had a professional relationship from day one. I gave my all for the team and I am sorry about his circumstances. However, that’s the way things are and I wish him all the best."