This is a [lexer][lexer] for [Pygments][pygments] that can lex the output of [BIND 9's `dig` command][dig] to provide colorful syntax highlighting for `dig`:
Then rehash your shell config or start a new session. Now calling `dig` will call this function instead, passing the arguments to the original `dig` command, e.g. in `/usr/bin/dig`, and pipe the output through `pygmentize`.
If necessary, you can still call the original dig by its full path, e.g. `/usr/bin/dig` instead of just `dig`.