I considered using CR as 15+DC. Problem is, with the way ability checks work, it's CR 25 to start getting information on CR 10 creatures, a roll that is very difficult for a guy who's trained in the relevant skill at the appropriate level for the encounter, and it goes downhill from there. The luck of the dice makes it decreasingly possible to have lore on it as players advance in level and meet equivalent opposition. Arguably, they meet rarer and more obscure monsters, but they also approach the pinnacle of their skill and should be able to recall equally obscure bits of knowledge.
Also, I prefer to say that what is known isn't necessarily what is the more useful knowledge for the players (saving throws, damage resistance and immunity, HP, special attacks). "Being from the plane of fire, XYZ is naturally immune to it" is something that could reasonably be self-apparent, while "he's trained in wisdom saves..." less.
I usually set the DC as 10+2*tier to have a base DC of 12-18 to determine if the creature is known, and appreciate the margin of success to determine what type of information is known. Encounter-breaking properties like damage immunity or resistance comes first, extrordinary abilities second, then the weakest saving throw. Success by 10ish gives access to the stat block.
I also rule that some informations are "common knowledge". If a player casts fireball at the fire elemental, I'd say that his... passive insight is enough to realize it won't work. Fire immunity of a fiend wouldn't be as "blatant".
If the PCs have time to discuss the monster an pool their knowledge and think, I ask for the most competent character to make the roll for everyone. If they are stumbling upon a monster, everyone rolls and they have to wait for the more competent ones to act and share their knowledge. One piece at a time (it's OK in my opinion within a round to say "don't use fire" or "don't stay near it, it can swallow you whole" but not pass the stat block. Since I don't allow Help action to remember something, I however allow to roll with advantage should one take an action to actively try to recollect knowledge. [I am sure I can tell you what the segment addition postulate is, from high school but it will take more than 6 seconds... ] [ok, more probably 6 hours but the PCs are heroes].