[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DNS madness on Woody



Pat Colbeck <pcolbeck@bashq.org> writes:
> 
> My PC is having weird DNS issues. I can pick a host on the internet and ping 
> it OK from the command line but my MTA (postfix) cannot resolve it. Another 
> weird thing is that I can add an address to the hosts file and ping will use 
> the address from the hosts file but postfix will ignore the entry in the 
> hosts file and use a DNS lookup instead.

Postfix, in its default configuration, does DNS queries directly.
Since it doesn't use the C library gethostbyXXX functions, it doesn't
consult "nsswitch.conf" or, ultimately, your "hosts" file.  Most mail
transfer agents are going to work this way because they have to check
for a DNS MX record first.  There's a configuration option to Postfix
to shut off DNS and use "gethostbyname" instead, but you don't want to
set this: your "hosts" file entries would work, but you'd break email
to most other domains (where the MX record is important).

> Jul 15 11:48:01 dasterdly postfix/smtp[22546]: 87E40114056: 
> to=<oldtools@clamor.law.cornell.edu>, relay=none, delay=1222, status=deferred 
> (Name service error for clamor.law.cornell.edu: Host not found, try again)

This probably just means there was a transient DNS problem (note the
"try again").  They happen all the time.  Postfix tried to deliver the
email, but for some reason, the name couldn't be resolved *at that
moment*.  Ping happens to work fine because the problem was only
temporary or because it was a problem with the MX record only.  The
mail will be retried later and, most likely, delivered correctly.

If the mail *stays* queued like this indefinitely, see the Postfix
FAQ:  "Mail stays queued with: Host not found, try again".

> This means I cannot mail people in our other offices as the
> mailserver will only accept SMTP mail from the internet and our DNS
> returns the internal address of the server (ie via the internal
> LAN).

How does everyone else send mail to people in your other office?  Does
everyone need to use a special entry in their "hosts" file?

> Jul 15 12:07:18 dasterdly postfix/smtp[22613]: 00AE41140C4: 
> to=<pcolbeck@azlan.com>, relay=azlan.com[10.44.5.133], delay=1, 
> status=bounced (host azlan.com[10.44.5.133] said: 550 5.7.1 Unable to relay 
> for pcolbeck@azlan.com).

The best fix would be to get whoever's responsible for your intranet
to fix the SMTP server at 10.44.5.133 so that it accepts email from
your machine without this "Unable to relay" bullshit.  The second best
fix would be to get whoever runs your internal DNS to add a proper MX
record for "azlan.com" that points to a host that *will* accept email
for it.

You can also try using the percent hack.  Try mailing to:

        pcolbeck%azlan.com@[193.129.67.7]

With a little luck, that'll work.

As a cleaner solution, you can configure Postfix to deliver all mail
that's addressed to a specific domain (i.e., "azlan.com") through a
specific host or IP address of your choosing.  Since I don't actually
use Postfix, I'm just guessing from the documentation, but I believe
you add a line like:

        azlan.com :[193.129.67.7]

to your "transport" table, rebuild it with "postmap
/etc/postfix/transport", and add a line like:

        transport_maps = hash:/etc/postfix/transport

to the "main.cf" file.

-- 
Kevin <buhr@telus.net>


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: