When I worked in the hospital, every nurse on the floor was aware when a patient was a DNR. This was announced at the beginning of shift report so all were aware. This was pediatrics, however, so there was usually not more than 1, maybe 2, DNRs on the floor at any given time. And pediatric DNRs can be children actively dying vs chronic older kids/young adults whose parents have simply decided that they aren't going to put their child, who has already been through so much, through CPR or intubation if anything were to happen.
If the patient is a DNR and has no family at the bedside, you find him and start CPR and then 20 seconds later his nurse walks in and says "he's a DNR" and you stop, what harm has been done? If the patient is not a DNR and you find him and don't start CPR while you search for the nurse to find out if he's a DNR, you've lost valuable time by the time you find out he's not and go back to start CPR.
My floor also had code buttons at every bedside. It would literally be less than 10 seconds before every available nurse or doctor on the floor would be in the room when you hit the button. Many a parent found that out the hard way when they hit the "staff assist" button to ask for a towel and 30 people ran to their bedside.