Automating dig queries