help with name checking script

Mark_Andrews at isc.org Mark_Andrews at isc.org
Tue Sep 28 23:16:48 UTC 1999


> I'm tyring to use a shell script to verify that our name server is
> running correctly and that the appropriate MX records exist. The problem
> I'm having is that when I run,"dig domain.com mx" it gives a return code
> of 0 even if there isn't an MX record for domain.com. Am I not using the
> correct options on dig or what?

	There is no error code for NODATA (as apposed to NXDOMAIN), it
	has to be inferred from the rest of the message.  See RFC 2308
	for how to do this.
> 
> I've tried doing the same thing with nslookup but with the same result.
> 
> Do I have to resort to parsing std out to determine if the MX record
> resolved correctly?

	Yes.

	Mark
> 
> BTW running SCO v5.0.4, bind v4.9.7 resolver libs, dig v2.2.
> 
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.
> 
--
Mark Andrews, Internet Software Consortium
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