Hi Pablo,

Pablo Pascual wrote:
> Sorry for response delay, these days I've been out of office.

Mail is store and forward.  It will wait.  :-)

> grep hosts /etc/nsswitch.conf:
> hosts:          files mdns4_minimal [NOTFOUND=return] dns ldap

Whenever I see mdns I have an immune reponse reaction.  But that
should be the problem here.  The very first entry is files.  That
means that /etc/hosts should be first in the priority for resolving
localhost.  And your data shows localhost there.

> grep localhost /etc/hosts:
> 127.0.0.1       localhost
> ::1     localhost ip6-localhost ip6-loopback

Good.

> getent hosts localhost:
> ::1             localhost ip6-localhost ip6-loopback

Good.  Resolving localhost works.  It just so happens that IPv6 is
preferred if both are available.  Therefore the ::1 is returned.

Those are all good but unfortunately to don't help to diagnose the
problem.  I was hoping to see that localhost wasn't found because it
had been moved from /etc/hosts or something.  Or that nsswitch.conf
had been modified not to use files.  But everything looks okay to me.
Which is in conflict with the error messages presented.

> > > /etc/cron.daily/spamassassin:
> > > unresolvable name: localhost at /usr/bin/sa-update line 432.
> > > sa-update failed for unknown reasons

That error says perl's resolver could not translate the name to the
address.  The name is "localhost".  Why can't it resolve localhost?
That is really quite a strange situation.  The name "localhost" should
always be resolved.  It should resolve to either 127.0.0.1 for an IPv4
address or it is possible ::1 for an IPv6 address.  But in your case
it is failing to do this.  And therefore the question comes about as
to why?

Can you ping localhost?  This is rather a brute force test but useful.

  ping localhost

What address is displayed when you ping localhost?  I expect to see
127.0.0.1 there.

And if that works then why doesn't Perl's line 432 resolve localhost?
That is the question.

Just to make sure we are looking at the same lines could you print
this out just to show us the lines around 432 in your file?  I am
expecting to see this there.

  $ cat -n /usr/bin/sa-update | sed -n '431,435p'
  431 } else {
  432   $res = Net::DNS::Resolver->new();
  433   $res->force_v4(1)  if $have_inet4 &&
  434                         $opt{'force_pf'} && $opt{'force_pf'} eq 'inet';
  435 }

Bob

Attachment: signature.asc
Description: Digital signature

Reply via email to