A dog fence is a barrier that encloses a yard or field to confine dogs within the boundaries of a property. It prevents dogs from wandering out, getting lost, bothering strangers, or damaging public or private property. It is made up of wire or wood posts lined together.