Re: Digging to the final IP

2014-10-24 Thread Doug Barton
On 10/21/14 8:31 PM, Frank Bulk wrote: Dave, Thanks for the input, but what I was looking for was a dig command that returns the IP(s) or a fail. It looks like the host command is the right solution in this case, not dig. Yep. :) You can check the return value of the call to get your fail as

Re: Digging to the final IP

2014-10-24 Thread Doug Barton
It's interesting to see the discussion about trying to turn dig into something it isn't. :) It's a really good DNS diagnostic tool, but if you just want to get the answer for a query, host does the job quite well, with a lot less fuss. Doug ___ Ple

Re: Digging to the final IP

2014-10-24 Thread John Wobus
On Oct 21, 2014, at 4:00 PM, Evan Hunt wrote: On Tue, Oct 21, 2014 at 12:07:15PM -0700, Warren Kumari wrote: dig A $name | awk '$0 ~ /status/ && $0 !~ /status: NOERROR,/ { sub(",", "", $6 ); print $6; x=1 } $4 == "A" { print $5; x=1 }

Re: Digging to the final IP

2014-10-23 Thread Niall O'Reilly
At Thu, 23 Oct 2014 15:17:49 +0100, Sam Wilson wrote: > > In article , > Bob Harold wrote: > > > Anytime you see 'grep' and 'cut' used together, they can usually be > > shortened to just 'awk', which requires starting one less process. And if > > this case it splits fields the way a users sees

Re: Digging to the final IP

2014-10-23 Thread Niall O'Reilly
At Thu, 23 Oct 2014 15:17:49 +0100, Sam Wilson wrote: > > In article , > Bob Harold wrote: > > > Anytime you see 'grep' and 'cut' used together, they can usually be > > shortened to just 'awk', which requires starting one less process. And if > > this case it splits fields the way a users sees

Re: Digging to the final IP

2014-10-23 Thread Sam Wilson
In article , Bob Harold wrote: > Anytime you see 'grep' and 'cut' used together, they can usually be > shortened to just 'awk', which requires starting one less process. And if > this case it splits fields the way a users sees them, so the same code > works in both cases: > > $ dig +noall +ans

Re: Digging to the final IP

2014-10-23 Thread Bob Harold
Anytime you see 'grep' and 'cut' used together, they can usually be shortened to just 'awk', which requires starting one less process. And if this case it splits fields the way a users sees them, so the same code works in both cases: $ dig +noall +answer home.kreme.com in a | awk '/[\t ]A[\t ]/ {

Re: Digging to the final IP

2014-10-22 Thread LuKreme
> On 21 Oct 2014, at 22:46 , Jim Young wrote: > > On 10/22/14 12:08 AM, "LuKreme" wrote: > >>> On 21 Oct 2014, at 19:20 , Dave Knight wrote: >>> >>> $ dig +noall +answer dave.knig.ht in a | egrep 'IN\tA\t' | cut -f6 >>> 216.235.14.46 >> >> Interesting. This works for me: >> >> dig +noall +

Re: Digging to the final IP

2014-10-22 Thread Dave Knight
On Oct 22, 2014, at 5:56, Niall O'Reilly wrote: > At Tue, 21 Oct 2014 22:31:28 -0500, > Frank Bulk wrote: >> >> Dave, >> >> Thanks for the input, but what I was looking for was a dig command that >> returns the IP(s) or a fail. It looks like the host command is the right >> solution in this c

Re: Digging to the final IP

2014-10-22 Thread Niall O'Reilly
At Tue, 21 Oct 2014 22:31:28 -0500, Frank Bulk wrote: > > Dave, > > Thanks for the input, but what I was looking for was a dig command that > returns the IP(s) or a fail. It looks like the host command is the right > solution in this case, not dig. Doesn't egrep fail on no match? Niall _

Re: Digging to the final IP

2014-10-21 Thread Jim Young
On 10/22/14 12:08 AM, "LuKreme" wrote: >> On 21 Oct 2014, at 19:20 , Dave Knight wrote: >> >> $ dig +noall +answer dave.knig.ht in a | egrep 'IN\tA\t' | cut -f6 >> 216.235.14.46 > >Interesting. This works for me: > >dig +noall +answer home.kreme.com in a | egrep '\tA' | cut -f5 > >but on your e

Re: Digging to the final IP

2014-10-21 Thread David Ford
# dig +noall +answer dave.knig.ht a|awk '/IN\tA\t/ {print $NF}' 216.235.14.46 signature.asc Description: OpenPGP digital signature ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing li

Re: Digging to the final IP

2014-10-21 Thread LuKreme
> On 21 Oct 2014, at 19:20 , Dave Knight wrote: > > $ dig +noall +answer dave.knig.ht in a | egrep 'IN\tA\t' | cut -f6 > 216.235.14.46 Interesting. This works for me: dig +noall +answer home.kreme.com in a | egrep '\tA' | cut -f5 but on your example, it requires -f6 And yet, the outputs appe

RE: Digging to the final IP

2014-10-21 Thread Frank Bulk
21, 2014 8:21 PM To: Frank Bulk Cc: bind-users Subject: Re: Digging to the final IP On Oct 19, 2014, at 1:26, Frank Bulk wrote: > Is there a dig option that will list out the final (IPs) or query result?? > By default, even with +short, it can list intermediate CNAME(s) and not what > I

Re: Digging to the final IP

2014-10-21 Thread Novosielski, Ryan
*Note: UMDNJ is now Rutgers-Biomedical and Health Sciences* || \\UTGERS |-*O*- ||_// Biomedical | Ryan Novosielski - Senior Technologist || \\ and Health | novos...@rutgers.edu- 973/972.0922 (2x0922) || \\ Sciences

Re: Digging to the final IP

2014-10-21 Thread Dave Knight
On Oct 19, 2014, at 1:26, Frank Bulk wrote: > Is there a dig option that will list out the final (IPs) or query result?? > By default, even with +short, it can list intermediate CNAME(s) and not what > IP(s) that CNAME may have. > > For example, > root@nagios:/tmp# dig mail.automatedwa

RE: Digging to the final IP

2014-10-21 Thread Darcy Kevin (FCA)
- Kevin -Original Message- From: bind-users-boun...@lists.isc.org [mailto:bind-users-boun...@lists.isc.org] On Behalf Of Warren Kumari Sent: Tuesday, October 21, 2014 3:07 PM To: Mark Andrews Cc: bind-us...@isc.org Subject: Re: Digging to the final IP On Mon, Oct 20, 2014 at 1:19 PM, Mark Andr

Re: Digging to the final IP

2014-10-21 Thread Evan Hunt
On Tue, Oct 21, 2014 at 12:07:15PM -0700, Warren Kumari wrote: > > dig A $name | awk '$0 ~ /status/ && $0 !~ /status: NOERROR,/ { > > sub(",", "", $6 ); print $6; x=1 > >} > >$4 == "A" { print $5; x=1 } > >END { if

Re: Digging to the final IP

2014-10-21 Thread Warren Kumari
On Mon, Oct 20, 2014 at 1:19 PM, Mark Andrews wrote: > > Why do we need to have a option to dig to massage the results into > every possible different form? > > dig A $name | awk '$0 ~ /status/ && $0 !~ /status: NOERROR,/ { > sub(",", "", $6 ); print $6; x=1 >

RE: Digging to the final IP

2014-10-20 Thread Frank Bulk
lf Of Phil Mayers Sent: Monday, October 20, 2014 8:39 AM To: bind-users@lists.isc.org Subject: Re: Digging to the final IP On 20/10/14 14:22, Frank Bulk (iname.com) wrote: > We're using this in a bash shell script. I don't think there's a native > shell command to get the IP

Re: Digging to the final IP

2014-10-20 Thread Mark Andrews
Why do we need to have a option to dig to massage the results into every possible different form? dig A $name | awk '$0 ~ /status/ && $0 !~ /status: NOERROR,/ { sub(",", "", $6 ); print $6; x=1 } $4 == "A" { print $5; x=1 }

Re: Digging to the final IP

2014-10-20 Thread Phil Mayers
On 20/10/14 14:22, Frank Bulk (iname.com) wrote: We’re using this in a bash shell script. I don’t think there’s a native shell command to get the IP, so I’ll use a mixture of host and dig as necessary. If your system has it, try "getent" e.g. getent ahosts hostname ___

RE: Digging to the final IP

2014-10-20 Thread Frank Bulk (iname.com)
-protocols-dns-b...@isc.org Subject: Re: Digging to the final IP What are you using this for? If it's part of a script, it might be easier to just use gethostbyname. For example, in php: http://php.net/manual/en/function.gethostbyname.php , Returns the IPv4 address or a string containin

Re: Digging to the final IP

2014-10-20 Thread Josh Kuo
If all you are after is one of the final IP addresses (not the entire set), then using a "dumb" client might be easier. For instance, 'ping'. $ ping -q -c1 www.google.com PING www.google.com (203.66.155.113): 56 data bytes If you want to get more than one IP address, then you'll need an intel

Re: Digging to the final IP

2014-10-19 Thread Fajar A. Nugraha
sc.org] On Behalf Of Barry Margolin > Sent: Sunday, October 19, 2014 5:00 AM > To: comp-protocols-dns-b...@isc.org > Subject: Re: Digging to the final IP > > In article , > Sten Carlsen wrote: > > > Would "host" be closer to what you want? > > Host also t

RE: Digging to the final IP

2014-10-19 Thread Frank Bulk
M To: comp-protocols-dns-b...@isc.org Subject: Re: Digging to the final IP In article , Sten Carlsen wrote: > Would "host" be closer to what you want? Host also tells you about aliases it encounters along the way. > > > -- > Best regards > > Sten Carlse

Re: Digging to the final IP

2014-10-19 Thread Barry Margolin
In article , Sten Carlsen wrote: > Would "host" be closer to what you want? Host also tells you about aliases it encounters along the way. > > > -- > Best regards > > Sten Carlsen > > No improvements come from shouting: > > "MALE BOVINE MANURE!!!" > > > On 19 Oct 2014, at 08:05, K

Re: Digging to the final IP

2014-10-19 Thread Sten Carlsen
Would "host" be closer to what you want? -- Best regards Sten Carlsen No improvements come from shouting: "MALE BOVINE MANURE!!!" > On 19 Oct 2014, at 08:05, Karl Auer wrote: > >> On Sun, 2014-10-19 at 00:26 -0500, Frank Bulk wrote: >> Is there a dig option that will list out the fin

Re: Digging to the final IP

2014-10-18 Thread Karl Auer
On Sun, 2014-10-19 at 00:26 -0500, Frank Bulk wrote: > Is there a dig option that will list out the final (IPs) or query result?? > By default, even with +short, it can list intermediate CNAME(s) and not what > IP(s) that CNAME may have. Not great, but might be enough to be helpful: dig +nons