I've always kept dogs. I also have horses and chickens. Since I don't want my dogs rolling in fresh horse "apples" or snacking on chicken poo, I built them a dog yard. It's about 60 x 80 and they are completely safe there. In the middle of the night when they decide they want out, I just open the door, secure in the knowledge that I am not going to have to chase them in the dark just because they discovered a rabbit or a deer. Saves me LOTS of aggravation. I consider the money for the dog yard to be bucks very well spent.
Maybe THAT's what you need?
Maybe THAT's what you need?