[Bug 854705] Re: dig returns 0 regardless of result of query

2015-10-22 Thread Jeff Silverman
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

[Bug 854705] Re: dig returns 0 regardless of result of query

2011-11-20 Thread Launchpad Bug Tracker
[Expired for bind9 (Ubuntu) because there has been no activity for 60 days.] ** Changed in: bind9 (Ubuntu) Status: Incomplete = Expired -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to bind9 in Ubuntu.

[Bug 854705] Re: dig returns 0 regardless of result of query

2011-09-21 Thread Lars Noodén
It's a work around but I'd still expect dig to return a non-zero number sometimes. -- 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

[Bug 854705] Re: dig returns 0 regardless of result of query

2011-09-21 Thread Stéphane Bortzmeyer
You never specified what you want. Sometimes??? Is that a specification? For instance, NXDOMAIN is *not* an error. May be you actually want something like: ADDRS=$(dig +short www.google.com); if [ -z $ADDRS ]; then echo FAILURE; else echo SUCCESS; fi For another example of testing dig results,

[Bug 854705] Re: dig returns 0 regardless of result of query

2011-09-20 Thread Lars Noodén
Sorry it should return 1 instead if the query failed. -- 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

[Bug 854705] Re: dig returns 0 regardless of result of query

2011-09-20 Thread Stéphane Bortzmeyer
What do you mean failed? NXDOMAIN? SERVFAIL? Timeout? They are very different things. I would strongly object to returning 1 when the answer is NXDOMAIN (the query succeeded). -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to bind9 in

[Bug 854705] Re: dig returns 0 regardless of result of query

2011-09-20 Thread Lars Noodén
I would expect dig to respond in this manner: dig +short www.google.com echo SUCCESS || echo FAILURE -- 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

[Bug 854705] Re: dig returns 0 regardless of result of query

2011-09-20 Thread Dave Walker
I'm not convinced the exit code can be handled how you want it. A lookup that returns NXDOMAIN was a successful lookup, so IMO shouldn't return an exit code of non-zero. is this not a valid work around for what you want? dig www.google.com | grep NOERROR 1/dev/null echo SUCCESS || echo FAILURE