You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Niek <ni...@asbak.coding-slaves.com> on 2005/06/09 13:18:16 UTC

Re: DNS lookups

On 6/9/2005 2:15 PM +0200, Ronan McGlue wrote:
> hi
> 
> SA is continually looking up my 3 mailhubs to our local DNS even though 
> i have them hardcoded into /etc/hosts and /etc/nsswitch.conf is 
> configured properly etc etc...
> 
> How can I make SA use the hosts file if such an option exists... anyone 
> else notice this behaviour??
> 
> ronan

perhaps the file to use is /etc/resolv.conf ?

Niek Baakman


Re: DNS lookups

Posted by jdow <jd...@earthlink.net>.
From: "Jeff Chan" <je...@surbl.org>

> On Thursday, June 9, 2005, 5:32:23 AM, Ronan McGlue wrote:
> > Niek wrote:
> >> On 6/9/2005 2:19 PM +0200, Ronan McGlue wrote:
> >> 
> >>> sry should have added that the DNS order in /etc/resolv.conf is also 
> >>> correct...
> >> 
> >> 
> >> What order ? The nameservers are used randomly...
> > again, my semantics need work... :S
> 
> > the DNS *is in* order in /etc/resolv.conf...
> 
> 
> > anyclues as to why SA isnt 'apparently' using the hosts file??
> 
> > ronan
> 
> Don't use /etc/hosts for anything other than specifying the
> basics of your local machine.  /etc/hosts is only used by the
> system during boot time before BIND is up.  After that, BIND
> is responsible for name resolution.

There is a nice little trick if you have this line in your /etc/host.conf
file: "order hosts,bind". Add addresses to which you do not want any
information sent to that list. The effect is amusing. It is also quite
handy when one of the SARE sites goes down. You can override the rotary
DNS lookup and actually make rules downloads.

{^_-}   <- sneaky old bit**, ain't I?


Re: DNS lookups

Posted by Ronan McGlue <r....@qub.ac.uk>.
Jeff Chan wrote:
> On Thursday, June 9, 2005, 5:32:23 AM, Ronan McGlue wrote:
> 
>>Niek wrote:
>>
>>>On 6/9/2005 2:19 PM +0200, Ronan McGlue wrote:
>>>
>>>
>>>>sry should have added that the DNS order in /etc/resolv.conf is also 
>>>>correct...
>>>
>>>
>>>What order ? The nameservers are used randomly...
>>
>>again, my semantics need work... :S
> 
> 
>>the DNS *is in* order in /etc/resolv.conf...
> 
> 
> 
>>anyclues as to why SA isnt 'apparently' using the hosts file??
> 
> 
>>ronan
> 
> 
> Don't use /etc/hosts for anything other than specifying the
> basics of your local machine.  /etc/hosts is only used by the
> system during boot time before BIND is up.  After that, BIND
> is responsible for name resolution.
> 
> Jeff C.
yes, but BIND isnt running on the machine in question... (atm)
The nets guys here are seeing a lot of lookups from this SPAMD machine 
for our mailhubs to the Local dns...
which is an extra couple of miliseconds i want to avoid by specifying 
them in the /etc/hosts file.
I've restarted INETD but the SPAMD machine is still looking up the hubs 
to send the results of the messages back...

-- 
========

Regards

Ronan McGlue
Info. Services
QUB

Re: DNS lookups

Posted by Jeff Chan <je...@surbl.org>.
On Thursday, June 9, 2005, 5:32:23 AM, Ronan McGlue wrote:
> Niek wrote:
>> On 6/9/2005 2:19 PM +0200, Ronan McGlue wrote:
>> 
>>> sry should have added that the DNS order in /etc/resolv.conf is also 
>>> correct...
>> 
>> 
>> What order ? The nameservers are used randomly...
> again, my semantics need work... :S

> the DNS *is in* order in /etc/resolv.conf...


> anyclues as to why SA isnt 'apparently' using the hosts file??

> ronan

Don't use /etc/hosts for anything other than specifying the
basics of your local machine.  /etc/hosts is only used by the
system during boot time before BIND is up.  After that, BIND
is responsible for name resolution.

Jeff C.
-- 
Jeff Chan
mailto:jeffc@surbl.org
http://www.surbl.org/


Re: DNS lookups

Posted by Jeff Chan <je...@surbl.org>.
On Thursday, June 9, 2005, 11:00:50 PM, Bob Proulx wrote:
> Kenneth Porter wrote:
>> Bob Proulx wrote:
>> > In both cases you would need to modify /etc/resolv.conf to use the
>> > local nameserver instead of the current one.
>> 
>> Wiki fodder?

> Good point.  Okay, here is the initial page with the above
> information.

>   http://wiki.apache.org/spamassassin/CachingNameserver

> Bob

Looks good, but might it be appropriate to add a section about
rbldnsd for high volume mail servers (more than 100,000 messages
per day)?  rbldnsd is immensely faster and smaller than BIND and
with rsync of the RBL zone files will prevent all external DNS
lookup, i.e. all hosted RBL lookups become local.

Jeff C.
-- 
Jeff Chan
mailto:jeffc@surbl.org
http://www.surbl.org/


Re: DNS lookups

Posted by Bob Proulx <bo...@proulx.com>.
Kenneth Porter wrote:
> Bob Proulx wrote:
> > In both cases you would need to modify /etc/resolv.conf to use the
> > local nameserver instead of the current one.
> 
> Wiki fodder?

Good point.  Okay, here is the initial page with the above
information.

  http://wiki.apache.org/spamassassin/CachingNameserver

Bob

Re: DNS lookups

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Thursday, June 09, 2005 10:25 AM -0600 Bob Proulx <bo...@proulx.com> 
wrote:

> Kenneth Porter wrote:
>> If it's a Red Hat system (including Fedora), just install the
>> caching-nameserver RPM. It pulls in BIND and installs appropriate config
>> files. Then edit resolv.conf to point to localhost.
>
> If it is a Debian system just install bind9 and the default
> configuration is a caching nameserver.
>
>   apt-get install bind9
>
> In both cases you would need to modify /etc/resolv.conf to use the
> local nameserver instead of the current one.

Wiki fodder?

Re: DNS lookups

Posted by Bob Proulx <bo...@proulx.com>.
Kenneth Porter wrote:
> If it's a Red Hat system (including Fedora), just install the 
> caching-nameserver RPM. It pulls in BIND and installs appropriate config 
> files. Then edit resolv.conf to point to localhost.

If it is a Debian system just install bind9 and the default
configuration is a caching nameserver.

  apt-get install bind9

In both cases you would need to modify /etc/resolv.conf to use the
local nameserver instead of the current one.

Bob

Re: DNS lookups

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Thursday, June 09, 2005 11:03 AM -0400 Steven Dickenson 
<st...@mrchuckles.net> wrote:

> We run bind with no zones on our SA gateway to serve as a DNS cache.
> Helps take a load off DNS lookups for common hosts.  You can easily do
> this with any other DNS daemon as well.  Google for caching nameserver.

If it's a Red Hat system (including Fedora), just install the 
caching-nameserver RPM. It pulls in BIND and installs appropriate config 
files. Then edit resolv.conf to point to localhost.

Re: DNS lookups

Posted by Steven Dickenson <st...@mrchuckles.net>.
Ronan McGlue wrote:
>> This is because SA doesn't use the system resolver, it uses Net::DNS's 
>> resolver. This gives SA a lot of control over queries, but doesn't 
>> take advantage of things like /etc/hosts, and only uses your primary DNS.
> 
> ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ok
> anyway i can hack it??
> *goes off to read CPAN*...

We run bind with no zones on our SA gateway to serve as a DNS cache. 
Helps take a load off DNS lookups for common hosts.  You can easily do 
this with any other DNS daemon as well.  Google for caching nameserver.

- S

Re: DNS lookups

Posted by jdow <jd...@earthlink.net>.
From: "Ronan McGlue" <r....@qub.ac.uk>

> Matt Kettler wrote:
> > At 08:32 AM 6/9/2005, Ronan McGlue wrote:
> >
> >> anyclues as to why SA isnt 'apparently' using the hosts file??
> >
> >
> > This is because SA doesn't use the system resolver, it uses Net::DNS's
> > resolver. This gives SA a lot of control over queries, but doesn't take
> > advantage of things like /etc/hosts, and only uses your primary DNS.
>
> ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ok
> anyway i can hack it??
> *goes off to read CPAN*...

tinydns. That's a caching only name server. It can reduce the number
of lookups for your primary DNS, perhaps.

{^_^}



Re: DNS lookups

Posted by Ronan McGlue <r....@qub.ac.uk>.
Matt Kettler wrote:
> At 08:32 AM 6/9/2005, Ronan McGlue wrote:
> 
>> anyclues as to why SA isnt 'apparently' using the hosts file??
> 
> 
> This is because SA doesn't use the system resolver, it uses Net::DNS's 
> resolver. This gives SA a lot of control over queries, but doesn't take 
> advantage of things like /etc/hosts, and only uses your primary DNS.

ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ok
anyway i can hack it??
*goes off to read CPAN*...
-- 
========

Regards

Ronan McGlue
Info. Services
QUB

Re: DNS lookups

Posted by Matt Kettler <mk...@comcast.net>.
At 08:32 AM 6/9/2005, Ronan McGlue wrote:

>anyclues as to why SA isnt 'apparently' using the hosts file??

This is because SA doesn't use the system resolver, it uses Net::DNS's 
resolver. This gives SA a lot of control over queries, but doesn't take 
advantage of things like /etc/hosts, and only uses your primary DNS. 


Re: DNS lookups

Posted by Ronan McGlue <r....@qub.ac.uk>.
Niek wrote:
> On 6/9/2005 2:19 PM +0200, Ronan McGlue wrote:
> 
>> sry should have added that the DNS order in /etc/resolv.conf is also 
>> correct...
> 
> 
> What order ? The nameservers are used randomly...
again, my semantics need work... :S

the DNS *is in* order in /etc/resolv.conf...


anyclues as to why SA isnt 'apparently' using the hosts file??

ronan

> 
> Niek Baakman


-- 
========

Regards

Ronan McGlue
Info. Services
QUB

Re: DNS lookups

Posted by Niek <ni...@asbak.coding-slaves.com>.
On 6/9/2005 2:19 PM +0200, Ronan McGlue wrote:
> sry should have added that the DNS order in /etc/resolv.conf is also 
> correct...

What order ? The nameservers are used randomly...

Niek Baakman

Re: DNS lookups

Posted by Ronan McGlue <r....@qub.ac.uk>.
Niek wrote:
> On 6/9/2005 2:15 PM +0200, Ronan McGlue wrote:
> 
>> hi
>>
>> SA is continually looking up my 3 mailhubs to our local DNS even 
>> though i have them hardcoded into /etc/hosts and /etc/nsswitch.conf is 
>> configured properly etc etc...
>>
>> How can I make SA use the hosts file if such an option exists... 
>> anyone else notice this behaviour??
>>
>> ronan
> 
> 
> perhaps the file to use is /etc/resolv.conf ?

sry should have added that the DNS order in /etc/resolv.conf is also 
correct...
> 
> Niek Baakman
> 


-- 
========

Regards

Ronan McGlue
Info. Services
QUB