My daughter has a Huskie in a residential neighborhood. She uses a wireless underground "fence" to keep her dog in the yard and has been happy with it.

They had little flags all around when she first put it in. The dog wears a collar with a shocking device to help him learn when not to go any farther.

I think it may be a system similar to the ones in this link, but you'll need to shop around befoe you buy. There are a lot of them reviewed in the link:

Wireless dog fence

The dogs ran a deer out of her yard one night this week. thumbup