From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Tue, 16 Jan 2007 13:44:29 -0500 From: "Russ Cox" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] $smtp dns failure In-Reply-To: <1ce6eebbc3d317dc6bbc8559d66eef12@coraid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1ce6eebbc3d317dc6bbc8559d66eef12@coraid.com> Topicbox-Message-UUID: 04a7db7a-ead2-11e9-9d60-3106f5b1d025 > there is an interesting case with mxlookup1() in mxdial.c. > if a dns /failure/ is reported for the mx lookup, then mxdial doesn't > try a/cname records. i've had trouble in the past with mx failures when the > a record looks up just fine. i'm not sure if the standard says one must quit > on dns failure. if there is a dns failure, the logic there is that since the mx could not be determined due to some transient dns error, we are not going to blindly try the underlying host name, because that is likely to be wrong. i am sure that i put this in because of actual problems. the real problem is that smtp is doing a dns lookup on 192.168.0.22, which ndb/dns interprets as a request for a reverse lookup (that is, it looks up 22.0.168.192.in-addr.arpa), which fails. mxlookup should probably check whether ds->host is a valid ip address all by itself, and then return 0 if so, rather than ask dns anything at all. unfortunately i don't think there is a library routine that will tell us whether a string is a valid ip address. parseip doesn't. russ