ok, can't speak for all dogs
but it worked with one of our dogs when I was growing up... buy him a cheap swimming pool (he might chew it up, so one of the cheap plastic kid pools is fine... and fill it with water... Labs LOVE water and often will just LAY in it...
but I do agree... a hidden perimeter fence with a collar on him is the best bet...
we had a lot of Blue Lacys and they ALL LOVE to dig... we were on hard clay cliche ground though and they wouldn't make it far... but sometimes would just dig a hole to put his nose in... looking for cooler air
never could break them from it though