Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Qmail: users

dns quary timeout

 

 

Qmail users RSS feed   Index | Next | Previous | View Threaded


vahid.moghaddasi at gmail

Feb 5, 2010, 7:04 AM

Post #1 of 10 (2849 views)
Permalink
dns quary timeout

Hi all,
I am trying to figure out why 'dnsqr any' or 'dig -t any' hangs for some
domains and not for others? What could be the problem?
Here are some example of bad returns:
# dnsqr any us.ibm.com
255 us.ibm.com:
timed out
# dnsqr any hud.gov
255 hud.gov:
timed out

# dnsqr any alum.mit.edu
255 alum.mit.edu:
timed out

And some good returns:
# dnsqr any ieee.com
255 ieee.com:
229 bytes, 1+4+4+4 records, response, noerror
query: 255 ieee.com
answer: ieee.com 172800 NS ns3.nominum.com
answer: ieee.com 172800 NS ns2.nominum.com
answer: ieee.com 172800 NS dns.ieee.com
answer: ieee.com 172800 NS auth01.ieee.com
authority: ieee.com 172800 NS auth01.ieee.com
authority: ieee.com 172800 NS dns.ieee.com
authority: ieee.com 172800 NS ns2.nominum.com
authority: ieee.com 172800 NS ns3.nominum.com
additional: auth01.ieee.com 172800 A 140.98.193.128
additional: dns.ieee.com 172800 A 140.98.194.128
additional: ns2.nominum.com 158566 A 81.200.68.218
additional: ns3.nominum.com 158566 A 64.89.228.11
# dnsqr any sun.com
255 sun.com:
153 bytes, 1+4+4+0 records, response, noerror
query: 255 sun.com
answer: sun.com 74415 NS ns8.sun.com
answer: sun.com 74415 NS ns3.sun.com
answer: sun.com 74415 NS ns2.sun.com
answer: sun.com 74415 NS ns1.sun.com
authority: sun.com 74415 NS ns2.sun.com
authority: sun.com 74415 NS ns1.sun.com
authority: sun.com 74415 NS ns3.sun.com
authority: sun.com 74415 NS ns8.sun.com
Where should I look for the problem?
Our DNS server is Bind.
Thank you very much.


kyle-qmail at memoryhole

Feb 5, 2010, 7:36 AM

Post #2 of 10 (2772 views)
Permalink
Re: dns quary timeout [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Friday, February 5 at 10:04 AM, quoth Vahid Moghaddasi:
>Where should I look for the problem?

I would start with your DNS server's log files. Is it crashing? Is it
not getting responses from an upstream server? All these questions and
more can (presumably) be answered by looking there.

~Kyle
- --
When the people fear the government, there is tyranny; when the
government fears the people, there is liberty.
-- Thomas Jefferson
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iQIcBAEBCAAGBQJLbDriAAoJECuveozR/AWe45YP/1K/n0B0KAK65H5dzwDE2VbN
tcfLMUby3TmczBIUJaReBr6oydqKFDy8oxwVxcCD2Zu+fYnZ5gGvaD9pRrUPgVUr
8GtMxVxKJ9Lq+zWZVLvw/EE31cqks9bRd42L49/95VhhkxtTuHqAn7y3cEo99us4
AgdXxvjE3/mNhgQCP4m2sPDIWa5EJTI3h2w0oCYN1PkCc5aWyfTNt+JWdT2yy2Z6
WZ7ebMFJ7MtvPvkzSrnDKSpRw9V3RemkkFFLLcM98q/T68UVZ9madGW6yqPGvWAc
SxBZDJlJWF9DzYT4ZJusJfLCUIqjofh2+ab/QV2e9Qz3eCKNA1DGTCZwRCevPOKp
ak9IWftgdNyxazz7r3mYOAsbTvbpGm6R9QqBys07xCJkgOimEUVGomyJtN/9ZZiZ
A269jLwcZC1RpXfubx/DKhfWWydT2BA5fHZYKsIHRJ12mHGyunUuzI2eBTxEjkgt
vO2C9oakl+pwzY7U6/1IVTaWNgTCsbw2P+9l6mfgIoo/UhFSSTmpalGMnyKwERGE
04Dl3g/IrvXsLX3Ruh81xAJsHswDw45FI3TUVvEdpr4f9gJjWefjONt56aEKKDHy
IPGUQXzkAsdN4tSYzpFKoNWFdwSnfbj/5UaDOC7e/Mvrn05I//qRixzEfRlYTDGc
kRT62A2hpfwRtsu26JRo
=lGYW
-----END PGP SIGNATURE-----


vahid.moghaddasi at gmail

Feb 17, 2010, 6:14 PM

Post #3 of 10 (2578 views)
Permalink
Re: dns quary timeout [In reply to]

On Fri, Feb 5, 2010 at 10:36 AM, Kyle Wheeler <kyle-qmail [at] memoryhole>wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On Friday, February 5 at 10:04 AM, quoth Vahid Moghaddasi:
> >Where should I look for the problem?
>
> I would start with your DNS server's log files. Is it crashing? Is it
> not getting responses from an upstream server? All these questions and
> more can (presumably) be answered by looking there.
>
There is no log in the main DNS server (bind) probably it took too much
space so they just direct it to /dev/null.
I get the following message in when using dig and it just stays there until
timeout, should it be that we need to open TCP port 53 from our mail servers
to ANY? Our FW guys never heard of TCP 53 for DNS so I need to fight now.
# dig -t ANY hud.gov
;; Truncated, retrying in TCP mode.

; <<>> DiG 9.3.4-P1 <<>> -t ANY hud.gov
;; global options: printcmd
;; connection timed out; no servers could be reached
Just a question, why qmail is calling for ANY to resolve MX records anyway?
Is there a way that I instruct qmail to just get the MX record which it
needs to send mail instead of ANY?
Thank you very much.


kyle-qmail at memoryhole

Feb 18, 2010, 9:54 AM

Post #4 of 10 (2566 views)
Permalink
Re: dns quary timeout [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Wednesday, February 17 at 09:14 PM, quoth Vahid Moghaddasi:
>There is no log in the main DNS server (bind) probably it took too
>much space so they just direct it to /dev/null.

Well, then obviously, your first step is to figure out how to turn on
logging so that you can see what it's doing.

>I get the following message in when using dig and it just stays there until
>timeout, should it be that we need to open TCP port 53 from our mail servers
>to ANY? Our FW guys never heard of TCP 53 for DNS so I need to fight now.

Well, then your firewall guys are idiots. DNS normally works via UDP,
but that places a limit on the amount of data that can be returned.
When a domain wishes to return a huge amount of data in a DNS request,
it does so via TCP.

>Just a question, why qmail is calling for ANY to resolve MX records
>anyway?

It's a workaround for a bug in old versions of bind (pre-4.9.4). In
those old versions of bind, if you made a CNAME request to a lame
server, the server would barf. Or, if that server didn't barf, the
next one might. The result of this was that qmail couldn't get mail
through to domains that are both lame and running such old versions of
bind. However, making an ANY query returned the necessary information
(and much more, obviously) but didn't trigger the same bug in bind.

Unfortunately, while quite rare, bind 4.9.4 is still in use by some
folks, despite the fact that its over 10 years old and has lots of
bugs and security holes. You can modify qmail to make CNAME queries
instead of ANY queries, but you have to then take responsibility for
what happens if the recipient domain is using an ancient version of
bind.

And yes, qmail has to make a CNAME request before it makes an MX
request; that's specified by the SMTP standard.

~Kyle
- --
I have great faith in fools; my friends call it self-confidence.
-- Edgar Allen Poe
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iQIcBAEBCAAGBQJLfX7ZAAoJECuveozR/AWezDsP/i4kpDoYs2OkZ/CXdw849kzj
X48l4Ej3jYo+RariMZU85xT39sVjpOA5MAJRM9LEtpbY2mq0g/HFqWPRd2wSvi5G
DlLYsWRTFxDmVROKDKMV8TmQAmgI2f4PFhgTVt6zrqfy75pmqHyDaj8Q6hLwTvcG
YAyiEbjZwLCcbSAunq9Aw3Cb02R/o1w5yiZq9Y7yJOJBWBw6b0cFWey9kdQ8CX8t
Jt19apwcRlkQQ57kwQIj9NYrarIfMbCBPak93WBcGrc7al6RdD2GUx4oySVltIhp
5DMzzF3KYikDE25JP0g6Lo/fr9fUpIjNvejdJbaXuElCBzKc2feXqMTAvh9JWDyf
Wov88bIyLa5AM6mbVsGr0IVrgPsaDcVPr0PnnjREL4PCe67oYlIalRHk3abBCd7n
0G0BaQPPhC1k98ihaYThsMyqvJBxTMUEPLTrtXyleQh21b2UEnAUP/eO8UNkLSDN
az/+1tUlbdp0NFHNzsWZZ0QabdDy/e/7FJlOIIgrbGft4pXWRlxBJBMcNTXufEf/
Fp4AFQBKPXlfRcS51qpH0n8Rv28Hc44Tr7aqk0cXDUmB7dTppPosLedh6Rcdx71h
eU2iVEpr4WInSLgyYFA4+byWYJ0klsxqeFDd+h1gd96EReV/JsMuzyc+sX2xneaE
MKeokcj0j+SMzGAzqawc
=RyRs
-----END PGP SIGNATURE-----


mail at sabahattin-gucukoglu

Feb 18, 2010, 4:59 PM

Post #5 of 10 (2564 views)
Permalink
Re: dns quary timeout [In reply to]

On 18 Feb 2010, at 17:54, Kyle Wheeler wrote:
> And yes, qmail has to make a CNAME request before it makes an MX
> request; that's specified by the SMTP standard.

No it isn't. That's broken qmail behaviour based on flawed interpretation of RFC 821 (clarified in 2821 and now 5321). If the MX turns out not to be canonical, by all means follow to the next name, which (according to RFC 1912 and many others) MUST be canonical. But don't start by making cname queries, unless of course you have a resolver that will not follow up for you (not dnscache).

Cheers,
Sabahattin


johnsonm at gmail

Feb 19, 2010, 12:31 PM

Post #6 of 10 (2558 views)
Permalink
Re: dns quary timeout [In reply to]

On Thu, Feb 18, 2010 at 11:54 AM, Kyle Wheeler
<kyle-qmail [at] memoryhole> wrote:
> Unfortunately, while quite rare, bind 4.9.4 is still in use by some
> folks, despite the fact that its over 10 years old and has lots of
> bugs and security holes. You can modify qmail to make CNAME queries
> instead of ANY queries, but you have to then take responsibility for
> what happens if the recipient domain is using an ancient version of
> bind.

Bind 4.9.X is rapidly approaching extinction. A recent survey that
probed authoritative name servers for a random sample of com/net/org
domains found 90 specimens:

http://dns.measurement-factory.com/surveys/200910.html

I'd love to know what domains those where, but they don't think they
disclose that information.


johnsonm at gmail

Feb 19, 2010, 12:37 PM

Post #7 of 10 (2538 views)
Permalink
Re: dns quary timeout [In reply to]

On Thu, Feb 18, 2010 at 6:59 PM, Sabahattin Gucukoglu
<mail [at] sabahattin-gucukoglu> wrote:
> On 18 Feb 2010, at 17:54, Kyle Wheeler wrote:
>> And yes, qmail has to make a CNAME request before it makes an MX
>> request; that's specified by the SMTP standard.
>
> No it isn't.  That's broken qmail behaviour based on flawed interpretation of RFC 821 (clarified in 2821 and now 5321).  If the MX turns out not to be canonical, by all means follow to the next name, which (according to RFC 1912 and many others) MUST be canonical.  But don't start by making cname queries, unless of course you have a resolver that will not follow up for you (not dnscache).

What do other MTAs (Postfix, Sendmail) do in this situation? Note
that I'm not interested in debating whether that behavior is correct
with regard to any particular RFCs.


mail at sabahattin-gucukoglu

Feb 19, 2010, 2:29 PM

Post #8 of 10 (2531 views)
Permalink
Re: dns quary timeout [In reply to]

On 19 Feb 2010, at 20:37, Mark Johnson wrote:
> On Thu, Feb 18, 2010 at 6:59 PM, Sabahattin Gucukoglu
> <mail [at] sabahattin-gucukoglu> wrote:
>> On 18 Feb 2010, at 17:54, Kyle Wheeler wrote:
>>> And yes, qmail has to make a CNAME request before it makes an MX
>>> request; that's specified by the SMTP standard.
>>
>> No it isn't. That's broken qmail behaviour based on flawed interpretation of RFC 821 (clarified in 2821 and now 5321). If the MX turns out not to be canonical, by all means follow to the next name, which (according to RFC 1912 and many others) MUST be canonical. But don't start by making cname queries, unless of course you have a resolver that will not follow up for you (not dnscache).
>
> What do other MTAs (Postfix, Sendmail) do in this situation? Note
> that I'm not interested in debating whether that behavior is correct
> with regard to any particular RFCs.

They do what you'd expect: look up MX records. Cname resolution is ipso-facto a prerequisite due to query restart logic of RFC 1034/5. Even Sendmail now defaults to this in its canonicalisation routines; if you switch them off entirely (feature(nocanonify)) you end up exactly where Postfix, Courier, XMail, ... are. Dan's wishes are come true, and not because Cname dereferencing is disallowed. The problem here seems to be that, because Dan works around bugs of BIND, and because ANY queries will not find you canonicalised results, he has to do two separate queries, and I've observed this actually causing a qmail to fail delivery on one particular setup due to this on a network where DNS was clearly not working properly even though MX lookups worked fine.

But anyway, I've found Courier now, and I'm most pleased. Hopefully someone will write a patch to make qmail 21st-century software.

Cheers,
Sabahattin


kyle-qmail at memoryhole

Feb 19, 2010, 2:42 PM

Post #9 of 10 (2531 views)
Permalink
Re: dns quary timeout [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Friday, February 19 at 12:59 AM, quoth Sabahattin Gucukoglu:
> On 18 Feb 2010, at 17:54, Kyle Wheeler wrote:
>> And yes, qmail has to make a CNAME request before it makes an MX
>> request; that's specified by the SMTP standard.
>
> No it isn't. That's broken qmail behaviour based on flawed
> interpretation of RFC 821 (clarified in 2821 and now 5321). If the
> MX turns out not to be canonical, by all means follow to the next
> name, which (according to RFC 1912 and many others) MUST be
> canonical. But don't start by making cname queries, unless of
> course you have a resolver that will not follow up for you (not
> dnscache).

You are correct IF all domains can be trusted to be correctly
configured.

The SMTP standard, in all its forms, does not permit the use of
aliased hostnames, so senders (i.e. qmail) must determine whether both
sending and receiving domains are aliases (e.g. CNAMEs).

As far as for the delivery, it is true that, according to several
RFCs, CNAMEs are not permitted to coexist with MX records for the same
name, and good DNS software will return the CNAME value in the
response to an MX query. However, the reality of the situation is that
MX and CNAME records for the same name sometimes *do* coexist (perhaps
less frequently these days than in years past, but it can still
happen). In cases where DNS servers have both an MX record and a CNAME
record for the same name, an MX query does not always return the CNAME
data, but *can* return just the MX value (depending on the DNS server
implementation). Even if it does respond with both values, not all DNS
client libraries will recognize the issue, and often simply ignore the
non-MX data (because you only asked for the MX data). In order to
properly deal with such incorrectly configured domains while
respecting the prohibition against aliases, qmail must make a separate
CNAME query in order to detect the alias.

If a domain is correctly configured, and no CNAME and MX records
overlap, then the only drawback of making the CNAME request first is
that more queries are made than are absolutely necessary. I don't see
what the basis is far calling qmail's behavior "broken"; it is
attempting to deal with potentially misconfigured domains.

~Kyle
- --
People demand freedom of speech to make up for the freedom of thought
which they avoid.
-- Soren Aabye Kierkegaard (1813-1855)
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iQIcBAEBCAAGBQJLfxPXAAoJECuveozR/AWeT84QAI6GTARwMDB3R3x7h82Rht6h
/q3Aieh5HM8zM3dzKSzYG9s/zuTDehYncrhGDzpsS8YVt+RmTjjUtGInuUK6WqGD
1KRvww7X59ntdXRqesojhxzAdwlLhEZNXJoXVCEU7Gk+ofmkl5wIAop+4JYxruYS
aopiq02lZPlbA7IVbUlRP4eJAGMHht4BWn+0TiSsXRoguxKzKBoilCrKYlzGrIMQ
2/J2LHRQyu2YzNtuV5RJ1oNAWlhsNmEw8HKF5DjbRvRvzFJe1wfUVNeaZks4l2qN
akr93nXBqhZSvbplEjB5Cm8RVaFNuL9EtnIS9lREv9jsXv0UBtZS0Vsz2/U9vSaH
IB7w64pZ09NaDR0Gjba10co9zBgJVDpHAZka/qznQrmE/k9cqSHhOOXQ3l71neMn
X+j966mYCGSixX0cU7qUIZkkBXHtWQ16Bh17nxNNbLoX0+mS8CSStp4GjcAN6oDe
dybBQX+Sv8guqOVHb9O0dvbS76L/v++yHl5GBEIb8WPkwCMc6gdHHfZi7DqGuW0M
eeJkiKNCG+pqzCvdeCIcT9phgjGqsfc7OYe2Thw8qgX2F+SThmOY5l4101Hh8HQ7
OhjPPmPKaZalnhgLZ7svrwYHbwKTUGySfbLDIorMGrlheypWvXLIlFh6fqEeYAND
RdvwLwGgBrHDBRVGdrqW
=MQa/
-----END PGP SIGNATURE-----


mail at sabahattin-gucukoglu

Feb 20, 2010, 1:48 PM

Post #10 of 10 (2465 views)
Permalink
Re: dns quary timeout [In reply to]

On 19 Feb 2010, at 22:42, Kyle Wheeler wrote:
> On Friday, February 19 at 12:59 AM, quoth Sabahattin Gucukoglu:
>> On 18 Feb 2010, at 17:54, Kyle Wheeler wrote:
>>> And yes, qmail has to make a CNAME request before it makes an MX
>>> request; that's specified by the SMTP standard.
>>
>> No it isn't. That's broken qmail behaviour based on flawed
>> interpretation of RFC 821 (clarified in 2821 and now 5321). If the
>> MX turns out not to be canonical, by all means follow to the next
>> name, which (according to RFC 1912 and many others) MUST be
>> canonical. But don't start by making cname queries, unless of
>> course you have a resolver that will not follow up for you (not
>> dnscache).
>
> You are correct IF all domains can be trusted to be correctly
> configured.
>
I have yet to see a domain *that* broken (BIND will disallow publication of such a zone, in fact). Certainly, it's my expectation today that domains not be, and I safely assume that to be the case for optimal mail delivery.

> The SMTP standard, in all its forms, does not permit the use of
> aliased hostnames, so senders (i.e. qmail) must determine whether both
> sending and receiving domains are aliases (e.g. CNAMEs).
>
The IETF today reconciles CNAME lookups in address envelope with the fundamental truth of CNAME evaluation in the DNS. There are indeed good reasons to avoid "Nicknames", but RFC 5321 (and indeed 2821) explain how this relates more to local nicknames and aliases than to any FQDNs, including FQDNs used as part of an email address and looked up in place of canonical names during the MX resolution process. There is simply no reason to go out of your way to avoid the process simply in order to distinguish CNAME usage from not. As I said, Dan simply misunderstands the connection between CNAME rewriting and CNAMEs used in the resolution restart process against MX records. His notes seem to corroborate that:
http://cr.yp.to/im/cname.html

In his example, www.your.site *must* be handled by your mailer. You *must* treat it local, and *must* accept or rewrite recipients accordingly (for Sendmail this is automagic since the typical local user delivery will work for "All my local names", or macro 'w'). In qmail this is just the rcpthosts file. This is a natural feature of any correct implementation of SMTP which simply expands MX records and delivers mail, as it always has and always will. There is no implied or mandatory rewriting here. There is only a rule that, wherever possible, aliases not be used, especially in RRs which might otherwise not provide efficient lookups in the DNS (MX, PTR, other CNAMEs).

> As far as for the delivery, it is true that, according to several
> RFCs, CNAMEs are not permitted to coexist with MX records for the same
> name, and good DNS software will return the CNAME value in the
> response to an MX query. However, the reality of the situation is that
> MX and CNAME records for the same name sometimes *do* coexist (perhaps
> less frequently these days than in years past, but it can still
> happen). In cases where DNS servers have both an MX record and a CNAME
> record for the same name, an MX query does not always return the CNAME
> data, but *can* return just the MX value (depending on the DNS server
> implementation). Even if it does respond with both values, not all DNS
> client libraries will recognize the issue, and often simply ignore the
> non-MX data (because you only asked for the MX data). In order to
> properly deal with such incorrectly configured domains while
> respecting the prohibition against aliases, qmail must make a separate
> CNAME query in order to detect the alias.
>
You can be justified in broken client behaviour if you have some preference of which set of MX RRs to use in such incredibly broken circumstances. If it were me, I'd simply use all MXs provided; it's the DNS server's job to do all that collection logic. But, in that case, the feature should certainly be optional. Otherwise, a breakage to work around a breakage is a nuisance when it doesn't work, as may be the case with the current thread.

> If a domain is correctly configured, and no CNAME and MX records
> overlap, then the only drawback of making the CNAME request first is
> that more queries are made than are absolutely necessary. I don't see
> what the basis is far calling qmail's behavior "broken"; it is
> attempting to deal with potentially misconfigured domains.
>
It's costing you an extra DNS query per MX lookup. It works around a bug or bugs that nobody cares about, or that rarely exist today. And it implements a feature most mailers are blindly unaware of, or indeed that most of them that go to the added trouble do not depend on to work. Really, if it's a feature, it's a very, very bad one. I prefer to call it a bug. :-)

Now, if you must have interoperability, then the software is working, albeit suboptimally, and is not broken. In any event, it's unusually conservative, given DJB's past history of breathing fire over matters of non-conformance, considering that this makes his software non-conformant itself. It is not behaviour specified by current standards. In my not very humble opinion, qmail should drop the CNAME/ANY routine, and do MX lookups instead.

Cheers,
Sabahattin

Qmail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.