9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] smtp dns failure: mx lookup
@ 2006-01-03  1:50 greg scott
  2006-01-03  9:31 ` Robert Raschke
  2006-01-03 12:18 ` erik quanstrom
  0 siblings, 2 replies; 6+ messages in thread
From: greg scott @ 2006-01-03  1:50 UTC (permalink / raw)
  To: 9fans

trying to send mail (Post tag in acme mail) results in
this /sys/log/smtp.fail entry
dns: dns failure (net!smtp.comcast.net)

the logs below from /sys/log/dns indicate that sending 
mail results in an MX type query (smtp.comcast.net mx)
which fails with "dns failure 25".

as a workaround to this send failure:
if "ip/ping smtp.comcast.net" is run first, mail does
get sent immediately, with no smtp.fail log.
this is good for 10 minutes, after which a new ping is
needed in order for new mail to be sent.

failed ("stuck") mail is sent out too after a successful send
due to the ping.

ip/ping results in an IP type query (smtp.comcast.net ip) which
succeeds, with dns returning ip addresses for smtp.comcast.net

192.168.0.1 is a router/firewall that forwards dns lookup requests
to comcast dns servers.

any ideas how to fix this?

/sys/log/dns details:

sending mail (acme Post tag) results in this mx query:

192.168.0.104 Jan  2 21:18:44 Twalk tag 15 fid 116 newfid 318 nwname 1 0:dns 
192.168.0.104 Jan  2 21:18:44 Rwalk tag 15 nwqid 1 0:(0000000000000001 72 )  22
192.168.0.104 Jan  2 21:18:44 Topen tag 15 fid 318 mode 2
192.168.0.104 Jan  2 21:18:44 Ropen tag 15 qid (0000000000000001 72 ) iounit 0  24
192.168.0.104 Jan  2 21:18:44 Twrite tag 15 fid 318 offset 0 count 19 'smtp.comcast.net mx'
192.168.0.104 Jan  2 21:18:44 dnresolve1 smtp.comcast.net 15 1
192.168.0.104 Jan  2 21:18:44 641.1: sending to 192.168.0.1/local#dns#server0 smtp.comcast.net mx
192.168.0.104 Jan  2 21:18:44 641: rcvd 192.168.0.1 flags: rd ra
192.168.0.104 Jan  2 21:18:44 641: rcvd 192.168.0.1 qd smtp.comcast.net
192.168.0.104 Jan  2 21:18:44 641: rcvd 192.168.0.1 ns comcast.net soa	dns01.jdc01.pa.comcast.net dnsadmin.comcast.net 1428 900 180 604800 3600
192.168.0.104 Jan  2 21:18:44 dnresolve1 smtp.comcast.net 5 1
192.168.0.104 Jan  2 21:18:44 641.1: sending to 192.168.0.1/local#dns#server0 smtp.comcast.net cname
192.168.0.104 Jan  2 21:18:44 641: rcvd 192.168.0.1 flags: rd ra
192.168.0.104 Jan  2 21:18:44 641: rcvd 192.168.0.1 qd smtp.comcast.net
192.168.0.104 Jan  2 21:18:44 641: rcvd 192.168.0.1 ns comcast.net soa	dns01.jdc01.pa.comcast.net dnsadmin.comcast.net 1428 900 180 604800 3600
192.168.0.104 Jan  2 21:18:44 Rerror tag 15 ename dns: dns failure 25
192.168.0.104 Jan  2 21:18:44 Tclunk tag 15 fid 318
192.168.0.104 Jan  2 21:18:44 Rclunk tag 15 7

--------

"ip/ping smtp.comcast.net"  results in this ip query:

192.168.0.104 Jan  2 21:20:25 Twalk tag 15 fid 166 newfid 295 nwname 1 0:dns 
192.168.0.104 Jan  2 21:20:25 Rwalk tag 15 nwqid 1 0:(0000000000000001 74 )  22
192.168.0.104 Jan  2 21:20:25 Topen tag 15 fid 295 mode 2
192.168.0.104 Jan  2 21:20:25 Ropen tag 15 qid (0000000000000001 74 ) iounit 0  24
192.168.0.104 Jan  2 21:20:25 Twrite tag 15 fid 295 offset 0 count 20 '!smtp.comcast.net ip'
192.168.0.104 Jan  2 21:20:25 dnresolve1 smtp.comcast.net 1 1
192.168.0.104 Jan  2 21:20:25 655.1: sending to 192.168.0.1/local#dns#server0 smtp.comcast.net ip
192.168.0.104 Jan  2 21:20:25 655: rcvd 192.168.0.1 flags: rd ra
192.168.0.104 Jan  2 21:20:25 655: rcvd 192.168.0.1 qd smtp.comcast.net
192.168.0.104 Jan  2 21:20:25 655: rcvd 192.168.0.1 an smtp.comcast.net ip	63.240.76.27
192.168.0.104 Jan  2 21:20:25 655: rcvd 192.168.0.1 an smtp.comcast.net ip	63.240.77.77
192.168.0.104 Jan  2 21:20:25 655: rcvd 192.168.0.1 an smtp.comcast.net ip	204.127.198.27
192.168.0.104 Jan  2 21:20:25 655: rcvd 192.168.0.1 an smtp.comcast.net ip	204.127.202.27
192.168.0.104 Jan  2 21:20:25 655: rcvd 192.168.0.1 an smtp.comcast.net ip	216.148.227.125
192.168.0.104 Jan  2 21:20:25 655: rcvd 192.168.0.1 an smtp.comcast.net ip	216.148.227.147
192.168.0.104 Jan  2 21:20:25 Rwrite tag 15 count 20 11
192.168.0.104 Jan  2 21:20:25 Tread tag 15 fid 295 offset 0 count 1022
192.168.0.104 Jan  2 21:20:25 Rread tag 15 count 39 'dom=smtp.comcast.net ip=216.148.227.147' 50
192.168.0.104 Jan  2 21:20:25 Tread tag 15 fid 295 offset 39 count 1022
192.168.0.104 Jan  2 21:20:25 Rread tag 15 count 38 'dom=smtp.comcast.net ip=204.127.202.27' 49
192.168.0.104 Jan  2 21:20:25 Tread tag 15 fid 295 offset 77 count 1022
192.168.0.104 Jan  2 21:20:25 Rread tag 15 count 38 'dom=smtp.comcast.net ip=204.127.198.27' 49
192.168.0.104 Jan  2 21:20:25 Tread tag 15 fid 295 offset 115 count 1022
192.168.0.104 Jan  2 21:20:25 Rread tag 15 count 36 'dom=smtp.comcast.net ip=63.240.77.77' 47
192.168.0.104 Jan  2 21:20:25 Tread tag 15 fid 295 offset 151 count 1022
192.168.0.104 Jan  2 21:20:25 Rread tag 15 count 36 'dom=smtp.comcast.net ip=63.240.76.27' 47
192.168.0.104 Jan  2 21:20:25 Tread tag 15 fid 295 offset 187 count 1022
192.168.0.104 Jan  2 21:20:25 Rread tag 15 count 39 'dom=smtp.comcast.net ip=216.148.227.125' 50
192.168.0.104 Jan  2 21:20:25 Tread tag 15 fid 295 offset 226 count 1022
192.168.0.104 Jan  2 21:20:25 Rread tag 15 count 0 <no data> 11
192.168.0.104 Jan  2 21:20:25 Tclunk tag 15 fid 295
192.168.0.104 Jan  2 21:20:25 Rclunk tag 15 7



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] smtp dns failure: mx lookup
  2006-01-03  1:50 [9fans] smtp dns failure: mx lookup greg scott
@ 2006-01-03  9:31 ` Robert Raschke
  2006-01-03 12:13   ` Steve Simon
  2006-01-03 12:18 ` erik quanstrom
  1 sibling, 1 reply; 6+ messages in thread
From: Robert Raschke @ 2006-01-03  9:31 UTC (permalink / raw)
  To: x-x, 9fans

greg scott wrote:
> trying to send mail (Post tag in acme mail) results in
> this /sys/log/smtp.fail entry
> dns: dns failure (net!smtp.comcast.net)

I don't have a solution, just a workaround.  I don't even understand
why it is happening.

I had the same problem whenever I had to fall back on using my ISP's
smtp server.  I got "around" this problem by adding a bit of guff in
front of the upas/smtp ...  line in /mail/lib/remotemail that does the
posting.  If you are always using smtp.comcast.net, then add this:

echo smtp.comcast.net |ndb/dnsquery >/dev/null

I also changed my remotemail to attempt direct delivery before falling
back to the ISP smtp server:

#!/bin/rc
shift
sender=$1
shift
addr=$1
shift
fd=`{/bin/upas/aliasmail -f $sender}
switch($fd){
case *.*
	;
case *
	fd=tombob.com
}
today=`{date}
if (upas/smtp -h $fd $addr $sender $*) {
	exit 0
}
echo $today : upas/smtp -h $fd tcp!smtp.blueyonder.co.uk $sender $* >>/sys/log/remotemail
echo smtp.blueyonder.co.uk |ndb/dnsquery >>/sys/log/remotemail
exec upas/smtp -h $fd tcp!smtp.blueyonder.co.uk $sender $*


Robby



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] smtp dns failure: mx lookup
  2006-01-03  9:31 ` Robert Raschke
@ 2006-01-03 12:13   ` Steve Simon
  0 siblings, 0 replies; 6+ messages in thread
From: Steve Simon @ 2006-01-03 12:13 UTC (permalink / raw)
  To: 9fans

> echo smtp.comcast.net |ndb/dnsquery >/dev/null

Yep, this is what I do too, I followed it through smtp(8)
a while ago and came to the conclussion it was a 
caching problem in dns(8).

looking at /sys/src/cmd/upas/smtp/mxdial.c:163 

smtp looks up "smtp.comcast.net mx" but receives "dns failure"
and gives up.

dns should reply "resource does not exist" which would prompt
smtp to retry with "smtp.comcast.net ip" which will succeed.

If you force the "smtp.comcast.net ip" into dns's cache using
the manual query above then it replies "resource does not exist"
correctly and smtp completes as it should.

After some time the entry ages out of the cache and the
problem reappears.

I used ndb/dnsdebug to prove that it was not a dns config problem
and put it on my To-Do list, where it has gathered dust.

A little more info, but no fix - only the same old bodge, sorry

-Steve


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [9fans] smtp dns failure: mx lookup
  2006-01-03  1:50 [9fans] smtp dns failure: mx lookup greg scott
  2006-01-03  9:31 ` Robert Raschke
@ 2006-01-03 12:18 ` erik quanstrom
  2006-01-03 14:39   ` Russ Cox
  1 sibling, 1 reply; 6+ messages in thread
From: erik quanstrom @ 2006-01-03 12:18 UTC (permalink / raw)
  To: 9fans, greg scott

dns is working just fine. there is no mx record for 
smtp.comcast.net. (dig smtp.comcast.net mx on linux). it shouldn't 
work after the ping, either.

comcast should have this record in their database:

smtp.comcast.net. $TTL in mx smtp.comcast.net.

i suffered the same problem when setting up my domain.

the solution is probablly to add smtp.comcast.net in your ndb
database. maybe upas should lookup the a/aaaa record if there's 
no mx record as a fallback. i'd be careful about doing that, though.

- erik


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] smtp dns failure: mx lookup
  2006-01-03 12:18 ` erik quanstrom
@ 2006-01-03 14:39   ` Russ Cox
  2006-01-04  2:28     ` erik quanstrom
  0 siblings, 1 reply; 6+ messages in thread
From: Russ Cox @ 2006-01-03 14:39 UTC (permalink / raw)
  To: erik quanstrom, Fans of the OS Plan 9 from Bell Labs

> the solution is probablly to add smtp.comcast.net in your ndb
> database. maybe upas should lookup the a/aaaa record if there's
> no mx record as a fallback. i'd be careful about doing that, though.

upas *does* look up the a record if the mx lookup says the name does not exist.
it does not look up the a record if the mx lookup fails.

russ


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] smtp dns failure: mx lookup
  2006-01-03 14:39   ` Russ Cox
@ 2006-01-04  2:28     ` erik quanstrom
  0 siblings, 0 replies; 6+ messages in thread
From: erik quanstrom @ 2006-01-04  2:28 UTC (permalink / raw)
  To: 9fans, Russ Cox

so, the question is, why does the mx lookup fail?
are your [a-j].root-servers.net entries up-to-date?
i'm not able to replicate the failure here:

; fn dns { n=() {if (~ $#* 1) n=ip; echo $* $n | 9p rdwr dns/dns}}
; dns smtp.comcast.net mx

write: dns: resource does not exist

; dns smtp.comcast.net

	63.240.77.77

on a related note, is there a way to make the dns fileserver return all 
the answers for a given question? 

Russ Cox <rsc@swtch.com> writes

| 
| > the solution is probablly to add smtp.comcast.net in your ndb
| > database. maybe upas should lookup the a/aaaa record if there's
| > no mx record as a fallback. i'd be careful about doing that, though.
| 
| upas *does* look up the a record if the mx lookup says the name does not exist.
| it does not look up the a record if the mx lookup fails.
| 
| russ


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-01-04  2:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-03  1:50 [9fans] smtp dns failure: mx lookup greg scott
2006-01-03  9:31 ` Robert Raschke
2006-01-03 12:13   ` Steve Simon
2006-01-03 12:18 ` erik quanstrom
2006-01-03 14:39   ` Russ Cox
2006-01-04  2:28     ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).