Here's a Debian bug report from 2019 for the same issue:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925591
** Bug watch added: Debian Bug tracker #925591
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925591
--
You received this bug notification because you are a member of Ubuntu
You can use grep to detect that dig returns a non-empty string
dig +short www.google.not-com | grep -v -e '^$' > /dev/null && echo
SUCCESS || echo FAILURE
prints FAILURE
dig +short www.google.com | grep -v -e '^$' > /dev/null && echo
SUCCESS || echo FAILURE
prints SUCCESS
--
You