getting the SOA e-mail

John Kerbawy john at MAKINTOSH.COM
Mon Jun 5 07:20:11 UTC 2000


Lee Howard wrote:
: How do you extract the e-mail address found on the SOA line from somebody
: else's server out there.  Will nslookup do this?
:
: You know what would be fun... if we had a script on our DNS servers that
: replied to that e-mail whenever we encountered a lame server or a 'points
: to a CNAME' error.

Here's a little kludge that will extract the contact email address.

% for i in `grep "Lame server on" /var/log/messages* | awk '{print $9}' |
sed -e "s/'//g"` ; do nslookup -q=soa $i 2> /dev/null | grep "mail addr" |
awk ' { print $4 } ' | sed -e 's/\./\@/' ; done

A friend of mine pointed out a problem with this:

What if the contact email address was ben.smith.cisco.com?
It would be translated into ben at smith.cisco.com instead of
ben.smith at cisco.com.

Solutions to this problem other than a hostname lookup?

Who in their right mind would put an email address like that in a SOA
entry anyway? Do any exist?

: So maybe they don't have their mail there... hmmm, would the consumed
: bandwidth be worth it?

I've thought about it many times, just never got around to writing a 
program to do it. :)

: Lee Howard

,---------------------------.  ,-----------------------------------.
\    John F. Kerbawy         \ \ "You don't want to be one of those \
 \   john at maKintosh.com       \ \ mindless futurists who sit in      \
  \  816.333.5407 \ john at EFnet \ \ front of a lonely screen." -       \
   `---------------------------' / Billington                         /
                                 `-----------------------------------'





More information about the bind-users mailing list