Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Aug 2002 14:18:25 -0400
From:      "Dan Langille" <dan@langille.org>
To:        Gregory Neil Shapiro <gshapiro@FreeBSD.ORG>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: why does this sendmail connection take so long?
Message-ID:  <3D6E2D31.29065.8EDA44C7@localhost>
In-Reply-To: <15726.24717.960548.333189@horsey.gshapiro.net>
References:  <3D6E243B.1515.8EB744E7@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
On 29 Aug 2002 at 10:57, Gregory Neil Shapiro wrote:

> dan> xeon.example.org.org.  5S IN A  127.0.0.1
>      ^^^^^^^^^^^^^^^^^^^^^
> 
> example.org's DNS zone has a mistake if it has an NS record pointing to a
> bogus hostname like that (and what's worse the bogus hostname resolves).

Ugh.  The NS entry was missing a trailing period.  Thank you.

> dan> dns_getcanonname: trying localhost.example.org (AAAA)
> dan> ;; res_querydomain(localhost, example.org, 1, 28)
> ...
> 
> dan> dan@m20.example.org... Connecting to xeon.example.org. via relay...
> 
> localhost.example.org appears to map to xeon.example.org, perhaps via
> /etc/hosts?

It did.  It no longer does.

> My first suggestion would be to fix your DNS zone as mentioned above.

On a side note, I noticed that localhost-v6.rev was not being used.  
I fixed that as well.

> Then, try the test again with more debugging:
> 
> echo 'hi there' | /usr/sbin/sendmail -v -d8.8,16.10,61.11 dan@m20.example.org

See "*** delay occurs here" below.

[dan@xeon:/etc/namedb] $ echo 'hi there' | /usr/sbin/sendmail -v -
d8.8,16.10,61.11 dan@m20.example.org
sm_gethostbyname(xeon.example.org, 28)... ;; 
res_querydomain(xeon.example.org, <Nil>, 1, 28)
;; res_query(xeon.example.org, 1, 28)
;; res_mkquery(0, xeon.example.org, 1, 28)
;; res_send()
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23051
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;;      xeon.example.org, type = AAAA, class = IN
;; Querying server (# 1) address = 127.0.0.1
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23051
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 
0
;;      xeon.example.org, type = AAAA, class = IN
example.org.         1D IN SOA       ns1.example.org. 
soa.example.org. (
                                        2002082903      ; serial
                                        3H              ; refresh
                                        30M             ; retry
                                        4w2d            ; expiry
                                        1D )            ; minimum

;; rcode = 0, ancount=0
;; res_querydomain(xeon.example.org, example.org, 1, 28)
;; res_query(xeon.example.org.example.org, 1, 28)
;; res_mkquery(0, xeon.example.org.example.org, 1, 28)
;; res_send()
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23052
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;;      xeon.example.org.example.org, type = AAAA, class = IN
;; Querying server (# 1) address = 127.0.0.1
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 23052
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 
0
;;      xeon.example.org.example.org, type = AAAA, class = IN
example.org.         1D IN SOA       ns1.example.org. 
soa.example.org. (
                                        2002082903      ; serial
                                        3H              ; refresh
                                        30M             ; retry
                                        4w2d            ; expiry
                                        1D )            ; minimum

;; rcode = 3, ancount=0
failure
failure
sm_gethostbyname(xeon.example.org, 2)... xeon.example.org
        addr: IPv6:c0a8:12::
dns_getcanonname(m20.example.org, trymx=1)
dns_getcanonname: trying m20.example.org. (AAAA)
;; res_querydomain(m20.example.org, , 1, 28)
;; res_query(m20.example.org., 1, 28)
;; res_mkquery(0, m20.example.org., 1, 28)
;; res_send()
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23053
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;;      m20.example.org, type = AAAA, class = IN
;; Querying server (# 1) address = 127.0.0.1
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23053
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 
0
;;      m20.example.org, type = AAAA, class = IN
example.org.         1D IN SOA       ns1.example.org. 
soa.example.org. (
                                        2002082903      ; serial
                                        3H              ; refresh
                                        30M             ; retry
                                        4w2d            ; expiry
                                        1D )            ; minimum

;; rcode = 0, ancount=0
        NO: errno=19, h_errno=4
dns_getcanonname: trying m20.example.org. (A)
;; res_querydomain(m20.example.org, , 1, 1)
;; res_query(m20.example.org., 1, 1)
;; res_mkquery(0, m20.example.org., 1, 1)
;; res_send()
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23054
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;;      m20.example.org, type = A, class = IN
;; Querying server (# 1) address = 127.0.0.1
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23054
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 
1
;;      m20.example.org, type = A, class = IN
m20.example.org.     1M IN A         216.187.106.227
example.org.         1M IN NS        xeon.example.org.
xeon.example.org.    1M IN A         192.168.0.18
        YES
dns_getcanonname: m20.example.org
getmxrr([localhost], droplocalhost=1)
dns_getcanonname(localhost, trymx=0)
dns_getcanonname: trying localhost.example.org (AAAA)
;; res_querydomain(localhost, example.org, 1, 28)
;; res_query(localhost.example.org, 1, 28)
;; res_mkquery(0, localhost.example.org, 1, 28)
;; res_send()
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23055
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;;      localhost.example.org, type = AAAA, class = IN
;; Querying server (# 1) address = 127.0.0.1
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23055
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 
0
;;      localhost.example.org, type = AAAA, class = IN
example.org.         1D IN SOA       ns1.example.org. 
soa.example.org. (
                                        2002082903      ; serial
                                        3H              ; refresh
                                        30M             ; retry
                                        4w2d            ; expiry
                                        1D )            ; minimum

;; rcode = 0, ancount=0
        NO: errno=19, h_errno=4
dns_getcanonname: trying localhost.example.org (A)
;; res_querydomain(localhost, example.org, 1, 1)
;; res_query(localhost.example.org, 1, 1)
;; res_mkquery(0, localhost.example.org, 1, 1)
;; res_send()
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23056
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;;      localhost.example.org, type = A, class = IN
;; Querying server (# 1) address = 127.0.0.1
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23056
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 
1
;;      localhost.example.org, type = A, class = IN
localhost.example.org.  1M IN A  127.0.0.1
example.org.         1M IN NS        xeon.example.org.
xeon.example.org.    1M IN A         192.168.0.18
        YES
dns_getcanonname: localhost.example.org
dan@m20.example.org... Connecting to localhost.example.org. via 
relay...
sm_gethostbyname(localhost.example.org., 28)... ;; 
res_querydomain(localhost.example.org., <Nil>, 1, 28)
;; res_query(localhost.example.org, 1, 28)
;; res_mkquery(0, localhost.example.org, 1, 28)
;; res_send()
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23057
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;;      localhost.example.org, type = AAAA, class = IN
;; Querying server (# 1) address = 127.0.0.1
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23057
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 
0
;;      localhost.example.org, type = AAAA, class = IN
example.org.         1D IN SOA       ns1.example.org. 
soa.example.org. (
                                        2002082903      ; serial
                                        3H              ; refresh
                                        30M             ; retry
                                        4w2d            ; expiry
                                        1D )            ; minimum

;; rcode = 0, ancount=0
failure
sm_gethostbyname(localhost, 28)... localhost
        alias: localhost.example.org
        addr: IPv6:::1
makeconnection (localhost.example.org. [IPv6:::1].25 (28))
makeconnection: fd=6

*** delay occurs here.

Connect failed (Operation timed out with localhost.example.org.); 
retrying with AF_INET....
sm_gethostbyname(localhost.example.org., 2)... ;; 
res_querydomain(localhost.example.org., <Nil>, 1, 1)
;; res_query(localhost.example.org, 1, 1)
;; res_mkquery(0, localhost.example.org, 1, 1)
;; res_send()
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23058
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;;      localhost.example.org, type = A, class = IN
;; Querying server (# 1) address = 127.0.0.1
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23058
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 
1
;;      localhost.example.org, type = A, class = IN
localhost.example.org.  1M IN A  127.0.0.1
example.org.         1M IN NS        xeon.example.org.
xeon.example.org.    1M IN A         192.168.0.18
localhost.example.org
        addr: IPv6:7f00:1::
makeconnection (localhost.example.org. [127.0.0.1].25 (2))
makeconnection: fd=6
220 xeon.example.org ESMTP Sendmail 8.12.5/8.12.5; Thu, 29 Aug 2002 
14:13:31 -0400 (EDT)
>>> EHLO xeon.example.org
250-xeon.example.org Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<dan@xeon.example.org> SIZE=9
250 2.1.0 <dan@xeon.example.org>... Sender ok
>>> RCPT To:<dan@m20.example.org>
>>> DATA
250 2.1.5 <dan@m20.example.org>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 g7TIDVRq084370 Message accepted for delivery
dan@m20.example.org... Sent (g7TIDVRq084370 Message accepted for 
delivery)
Closing connection to localhost.example.org.
>>> QUIT
221 2.0.0 xeon.example.org closing connection
[dan@xeon:/etc/namedb] $

Thank you.
-- 
Dan Langille
I'm looking for a computer job:
http://www.freebsddiary.org/dan_langille.php


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D6E2D31.29065.8EDA44C7>