Digging to the final IP

Mark Andrews marka at isc.org
Mon Oct 20 20:19:08 UTC 2014


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 }
		   END { if (!x) print "TIMEOUT" }'

Mark


In message <54451077.8030907 at imperial.ac.uk>, Phil Mayers writes:
> On 20/10/14 14:22, Frank Bulk (iname.com) wrote:
> > We=92re using this in a bash shell script.  I don=92t think there=92s a n=
> ative
> > shell command to get the IP, so I=92ll use a mixture of host and dig as
> > necessary.
> 
> If your system has it, try "getent" e.g.
> 
> getent ahosts hostname
> _______________________________________________
> Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscri=
> be from this list
> 
> bind-users mailing list
> bind-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-users
-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: marka at isc.org


More information about the bind-users mailing list