It turns out that the host command will do what you want.

jeffs@jeffs-desktop:~$ host www.g00gle.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases: 

Host www.g00gle.com not found: 2(SERVFAIL)
jeffs@jeffs-desktop:~$ echo $?
1     <=================================================== 
jeffs@jeffs-desktop:~$ host www.google.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases: 

www.google.com has address 216.58.216.164
www.google.com has IPv6 address 2607:f8b0:400a:805::1013
jeffs@jeffs-desktop:~$ echo $?
0
jeffs@jeffs-desktop:~$ host www.google.com 10.82.34.123
;; connection timed out; no servers could be reached
jeffs@jeffs-desktop:~$ echo $?
1
jeffs@jeffs-desktop:~$

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to bind9 in Ubuntu.
https://bugs.launchpad.net/bugs/854705

Title:
  dig returns 0 regardless of result of query

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bind9/+bug/854705/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to