dog randomly becoming possessive

Emily • Wife // coffee snob // Gemini
I've had my fur baby for almost five years now. And I've been dating my boyfriend for six and a half so they're very familiar with each other. 
My dog bit my boyfriend the other night and had growled at him when he came upstairs to go to bed for the last three nights. 
I think my dog is stressed bc we live with my roommates dad since the flooding happened in Louisiana. My roommate and his dad do not like my dog. But my boyfriends behavior to him hasnt changed. 
And he only does this when he's coming up the stairs. My dog doesn't sleep in the bed with us anymore either. I don't know what my pups deal is, but does anyone know what I should do? I don't want to punish him for letting me know something is wrong or he's uncomfortable. Maybe I'm pregnant and he's being protective bc he can sense it lol. I can hope can't I?