Right, see, I said "intelligently." If your DM is treating the dragon as if it is unaware of the existence of crossbows, he is doing it wrong. A smart dragon would fight outdoors only on a windy day (disadvantage for ranged weapon attacks), and it would almost never fight outside the region that counts as its lair. Against ranged attackers, a blue or white dragon would more likely burrow than fly; green or black would prefer to fight deep underwater. They would all do everything possible to keep you from having a clear shot as they let their breath recharge. Also, spellcasting dragons have plenty of ways to stymie ranged attacks.
People seem to enjoy a very restrictive reading of the word "lair," by the way. In my game, if a dragon lives inside a mountain, then that whole mountain is its lair, so lair effects can be used anywhere in, on, or above that mountain. Regional effects extend one mile beyond that.