The Times report that City are considering a move for the Brazilian as they weigh up their transfer options this summer.
Danilo is valued at around £21 million by the Spanish giants. The Brazilian was unable to hold down a regular spot at Madrid under Zinedine Zidane, making just 17 league appearances last season.
Reports have linked City with AS Monaco defender Benjamin Mendy as well as the aforementioned Danilo.
Chelsea will still feel confident about completing a deal for the Brazilian as they also eye a move for Alex Sandro to kick start their summer recruitment drive.
Guardiola is continuing to shape his Manchester City squad to his liking after moving Pablo Zabaleta, Gael Clichy and Bacary Sagna out of the club this summer.
City have also completed summer deals for Bernardo Silva and Portuguese goalkeeper Ederson.