Did Danzo know that the Rinnegan existed?
He should have known before the Konoha-attack. Years before, he worked together with Hanzo, who was attacked by Nagato using his Rinnegan. Back then, Danzo most likely came to know about the reason why his men got killed.

Source: Chapter 447