Marc

So what happens if you run a local nameserver in caching mode? You may find 
this reduces the DNS related query time (and for that matter overall SA 
processing) dramitcally).

--
Martin Hepworth
Snr Systems Administrator
Solid State Logic
Tel: +44 (0)1865 842300

> -----Original Message-----
> From: Marc Perkel [mailto:[EMAIL PROTECTED]
> Sent: 28 August 2008 16:41
> To: users@spamassassin.apache.org
> Subject: Handy script for generating /etc/resolv.conf
>
> Here's something I threw together to make sure the
> /etc/resolv.conf points to a working nameserver. I run this
> once a minute. It checks to see what name servers are up and
> creates /etc/resolv.conf. As you all know SA and mail servers
> need the first nameserver to always be working.
>
> #!/bin/bash
>
> # This program is run once a minute and automatically
> generates the /etc/resolv.conf file
>
> DEFAULTSERVERS="65.49.42.30 65.49.42.31 65.49.42.33 69.50.231.141"
>
> # If default isn't optimum then read
> /etc/sysconfig/local-servers for list
>
> [ -f /etc/sysconfig/local-nameservers ] && .
> /etc/sysconfig/local-nameservers
>
> echo "# Automatically generated by $0" > /etc/resolv.tmp echo
> >> /etc/resolv.tmp echo "domain ctyme.com" >> /etc/resolv.tmp
> echo >> /etc/resolv.tmp
>
> for ns in $LOCALNAMESERVERS $DEFAULTSERVERS; do
>    /usr/bin/nc -w 3 -z $ns 53 | cut -d \  -f 3 | sed -e
> 's/^.*$/nameserver \0/' >> /etc/resolv.tmp done
>
> # resolv.conf only allows 3 nameservers so truncate list to 7 lines
>
> head -n 7 /etc/resolv.tmp > /etc/resolv.conf rm /etc/resolv.tmp
>




**********************************************************************
Confidentiality : This e-mail and any attachments are intended for the 
addressee only and may be confidential. If they come to you in error 
you must take no action based on them, nor must you copy or show them 
to anyone. Please advise the sender by replying to this e-mail 
immediately and then delete the original from your computer.
Opinion : Any opinions expressed in this e-mail are entirely those of 
the author and unless specifically stated to the contrary, are not 
necessarily those of the author's employer.
Security Warning : Internet e-mail is not necessarily a secure 
communications medium and can be subject to data corruption. We advise 
that you consider this fact when e-mailing us. 
Viruses : We have taken steps to ensure that this e-mail and any 
attachments are free from known viruses but in keeping with good 
computing practice, you should ensure that they are virus free.

Red Lion 49 Ltd T/A Solid State Logic
Registered as a limited company in England and Wales 
(Company No:5362730)
Registered Office: 25 Spring Hill Road, Begbroke, Oxford OX5 1RU, 
United Kingdom
**********************************************************************

Reply via email to