This is a discussion on CNAME_lookup_failed_temporarily within the alt.comp.mail.qmail forums, part of the Mail Servers and Related category; Dear all , I can't send emails to all members of one domain . when I viewed maillog , I saw the ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Dear all ,
I can't send emails to all members of one domain . when I viewed maillog , I saw the error message CNAME_lookup_failed_temporarily. I , however , was able to send emails to the domain last few months . but it suddenly didn't work in that few days. I , use the command "dig mx" , it shows the result : ;; res options: init recurs defnam dnsrch ;; res_nsend to server default -- 10.225.36.5: Operation timed out I use the dig command to other domain , it works properly. How can I solve this problem ? Many Thanks in advance!! Stanley |
|
|||
|
ssin@comelong.com.hk (Stanley Sin) writes:
> I , use the command "dig mx" , it shows the result : > > ;; res options: init recurs defnam dnsrch > ;; res_nsend to server default -- 10.225.36.5: Operation timed out > I use the dig command to other domain , it works properly. How can > I solve this problem ? You can't, really. The remote site has a DNS problem. -- Dave Sill Oak Ridge National Lab, Workstation Support Author, The qmail Handbook <http://web.infoave.net/~dsill> <http://lifewithqmail.org/>: Almost everything you always wanted to know. |
|
|||
|
SS> How can I solve this problem ?
Who knows! It could be one of several problems; and because you've decided to hide important information from us, such as *the actual domain names involved*, we don't know which of those problems it actually is and thus how you can solve it. |
|
|||
|
Really thanks for your reply .
Today , I sent emails to the remote site again . It didn't the error message "CNAME_lookup_failed_temporarily " , it showed the process success. Howvever , the remote site was still not able to receive my emails. Also , the dig command also showed the same result. I searched this problem from the web , some said it was a DNS problem ,some said it was qmail can't receive over 512-byte DNS response . I used dig command to dig aol.com , it showed the same "operation timed out" result . but others work. As you said , it is a remote site DNS problem , how to tell him more detailed to fix the DNS problem. If part of the problem is caused by the packet size .I don't how to amend the dns.c file to fix this problem. Thanks again my dns.c file is also following: #include <stdio.h> #include <netdb.h> #include <sys/types.h> #include <netinet/in.h> #include <arpa/nameser.h> #include <resolv.h> #include <errno.h> extern int res_query(); extern int res_search(); extern int errno; extern int h_errno; #include "ip.h" #include "ipalloc.h" #include "fmt.h" #include "alloc.h" #include "str.h" #include "stralloc.h" #include "dns.h" #include "case.h" static unsigned short getshort(c) unsigned char *c; { unsigned short u; u = c[0]; return (u << 8) + c[1]; } static struct { unsigned char *buf; } response; static int responsebuflen = 0; static int responselen; static unsigned char *responseend; static unsigned char *responsepos; static u_long saveresoptions; static int numanswers; static char name[MAXDNAME]; static struct ip_address ip; unsigned short pref; static stralloc glue = {0}; static int (*lookup)() = res_query; static int resolve(domain,type) stralloc *domain; int type; { int n; int i; errno = 0; if (!stralloc_copy(&glue,domain)) return DNS_MEM; if (!stralloc_0(&glue)) return DNS_MEM; if (!responsebuflen) if (response.buf = (unsigned char *)alloc(PACKETSZ+1)) responsebuflen = PACKETSZ+1; else return DNS_MEM; responselen = lookup(glue.s,C_IN,type,response.buf,responsebufle n); if ((responselen >= responsebuflen) || (responselen > 0 && (((HEADER *)response.buf)->tc))) { if (responsebuflen < 65536) if (alloc_re(&response.buf, responsebuflen, 65536)) responsebuflen = 65536; else return DNS_MEM; saveresoptions = _res.options; _res.options |= RES_USEVC; responselen = lookup(glue.s,C_IN,type,response.buf,responsebufle n); _res.options = saveresoptions; } if (responselen <= 0) { if (errno == ECONNREFUSED) return DNS_SOFT; if (h_errno == TRY_AGAIN) return DNS_SOFT; return DNS_HARD; } responseend = response.buf + responselen; responsepos = response.buf + sizeof(HEADER); n = ntohs(((HEADER *)response.buf)->qdcount); while (n-- > 0) { i = dn_expand(response.buf,responseend,responsepos,nam e,MAXDNAME); if (i < 0) return DNS_SOFT; responsepos += i; i = responseend - responsepos; if (i < QFIXEDSZ) return DNS_SOFT; responsepos += QFIXEDSZ; } numanswers = ntohs(((HEADER *)response.buf)->ancount); return 0; } static int findname(wanttype) int wanttype; { unsigned short rrtype; unsigned short rrdlen; int i; if (numanswers <= 0) return 2; --numanswers; if (responsepos == responseend) return DNS_SOFT; i = dn_expand(response.buf,responseend,responsepos,nam e,MAXDNAME); if (i < 0) return DNS_SOFT; responsepos += i; i = responseend - responsepos; if (i < 4 + 3 * 2) return DNS_SOFT; rrtype = getshort(responsepos); rrdlen = getshort(responsepos + 8); responsepos += 10; if (rrtype == wanttype) { if (dn_expand(response.buf,responseend,responsepos,na me,MAXDNAME) < 0) return DNS_SOFT; responsepos += rrdlen; return 1; } responsepos += rrdlen; return 0; } static int findip(wanttype) int wanttype; { unsigned short rrtype; unsigned short rrdlen; int i; if (numanswers <= 0) return 2; --numanswers; if (responsepos == responseend) return DNS_SOFT; i = dn_expand(response.buf,responseend,responsepos,nam e,MAXDNAME); if (i < 0) return DNS_SOFT; responsepos += i; i = responseend - responsepos; if (i < 4 + 3 * 2) return DNS_SOFT; rrtype = getshort(responsepos); rrdlen = getshort(responsepos + 8); responsepos += 10; if (rrtype == wanttype) { if (rrdlen < 4) return DNS_SOFT; ip.d[0] = responsepos[0]; ip.d[1] = responsepos[1]; ip.d[2] = responsepos[2]; ip.d[3] = responsepos[3]; responsepos += rrdlen; return 1; } responsepos += rrdlen; return 0; } static int findmx(wanttype) int wanttype; { unsigned short rrtype; unsigned short rrdlen; int i; if (numanswers <= 0) return 2; --numanswers; if (responsepos == responseend) return DNS_SOFT; i = dn_expand(response.buf,responseend,responsepos,nam e,MAXDNAME); if (i < 0) return DNS_SOFT; responsepos += i; i = responseend - responsepos; if (i < 4 + 3 * 2) return DNS_SOFT; rrtype = getshort(responsepos); rrdlen = getshort(responsepos + 8); responsepos += 10; if (rrtype == wanttype) { if (rrdlen < 3) return DNS_SOFT; pref = (responsepos[0] << 8) + responsepos[1]; if (dn_expand(response.buf,responseend,responsepos + 2,name,MAXDNAME) < 0) return DNS_SOFT; responsepos += rrdlen; return 1; } responsepos += rrdlen; return 0; } void dns_init(flagsearch) int flagsearch; { res_init(); if (flagsearch) lookup = res_search; } int dns_cname(sa) stralloc *sa; { int r; int loop; for (loop = 0;loop < 10;++loop) { if (!sa->len) return loop; if (sa->s[sa->len - 1] == ']') return loop; if (sa->s[sa->len - 1] == '.') { --sa->len; continue; } switch(resolve(sa,T_ANY)) { case DNS_MEM: return DNS_MEM; case DNS_SOFT: return DNS_SOFT; case DNS_HARD: return loop; default: while ((r = findname(T_CNAME)) != 2) { if (r == DNS_SOFT) return DNS_SOFT; if (r == 1) { if (!stralloc_copys(sa,name)) return DNS_MEM; break; } } if (r == 2) return loop; } } return DNS_HARD; /* alias loop */ } #define FMT_IAA 40 static int iaafmt(s,ip) char *s; struct ip_address *ip; { unsigned int i; unsigned int len; len = 0; i = fmt_ulong(s,(unsigned long) ip->d[3]); len += i; if (s) s += i; i = fmt_str(s,"."); len += i; if (s) s += i; i = fmt_ulong(s,(unsigned long) ip->d[2]); len += i; if (s) s += i; i = fmt_str(s,"."); len += i; if (s) s += i; i = fmt_ulong(s,(unsigned long) ip->d[1]); len += i; if (s) s += i; i = fmt_str(s,"."); len += i; if (s) s += i; i = fmt_ulong(s,(unsigned long) ip->d[0]); len += i; if (s) s += i; i = fmt_str(s,".in-addr.arpa."); len += i; if (s) s += i; return len; } int dns_ptr(sa,ip) stralloc *sa; struct ip_address *ip; { int r; if (!stralloc_ready(sa,iaafmt((char *) 0,ip))) return DNS_MEM; sa->len = iaafmt(sa->s,ip); switch(resolve(sa,T_PTR)) { case DNS_MEM: return DNS_MEM; case DNS_SOFT: return DNS_SOFT; case DNS_HARD: return DNS_HARD; } while ((r = findname(T_PTR)) != 2) { if (r == DNS_SOFT) return DNS_SOFT; if (r == 1) { if (!stralloc_copys(sa,name)) return DNS_MEM; return 0; } } return DNS_HARD; } static int dns_ipplus(ia,sa,pref) ipalloc *ia; stralloc *sa; int pref; { int r; struct ip_mx ix; if (!stralloc_copy(&glue,sa)) return DNS_MEM; if (!stralloc_0(&glue)) return DNS_MEM; #ifdef TLS if (!(ix.fqdn = alloc(glue.len) ) ) return DNS_MEM; byte_copy(ix.fqdn, glue.len, glue.s); #endif if (glue.s[0]) { ix.pref = 0; if (!glue.s[ip_scan(glue.s,&ix.ip)] || !glue.s[ip_scanbracket(glue.s,&ix.ip)]) { if (!ipalloc_append(ia,&ix)) return DNS_MEM; return 0; } } switch(resolve(sa,T_A)) { case DNS_MEM: return DNS_MEM; case DNS_SOFT: return DNS_SOFT; case DNS_HARD: return DNS_HARD; } while ((r = findip(T_A)) != 2) { ix.ip = ip; ix.pref = pref; if (r == DNS_SOFT) return DNS_SOFT; if (r == 1) if (!ipalloc_append(ia,&ix)) return DNS_MEM; } return 0; } int dns_ip(ia,sa) ipalloc *ia; stralloc *sa; { if (!ipalloc_readyplus(ia,0)) return DNS_MEM; ia->len = 0; return dns_ipplus(ia,sa,0); } int dns_mxip(ia,sa,random) ipalloc *ia; stralloc *sa; unsigned long random; { int r; struct mx { stralloc sa; unsigned short p; } *mx; struct ip_mx ix; int nummx; int i; int j; int flagsoft; if (!ipalloc_readyplus(ia,0)) return DNS_MEM; ia->len = 0; if (!stralloc_copy(&glue,sa)) return DNS_MEM; if (!stralloc_0(&glue)) return DNS_MEM; if (glue.s[0]) { ix.pref = 0; if (!glue.s[ip_scan(glue.s,&ix.ip)] || !glue.s[ip_scanbracket(glue.s,&ix.ip)]) { if (!ipalloc_append(ia,&ix)) return DNS_MEM; return 0; } } switch(resolve(sa,T_MX)) { case DNS_MEM: return DNS_MEM; case DNS_SOFT: return DNS_SOFT; case DNS_HARD: return dns_ip(ia,sa); } mx = (struct mx *) alloc(numanswers * sizeof(struct mx)); if (!mx) return DNS_MEM; nummx = 0; while ((r = findmx(T_MX)) != 2) { if (r == DNS_SOFT) { alloc_free(mx); return DNS_SOFT; } if (r == 1) { mx[nummx].p = pref; mx[nummx].sa.s = 0; if (!stralloc_copys(&mx[nummx].sa,name)) { while (nummx > 0) alloc_free(mx[--nummx].sa.s); alloc_free(mx); return DNS_MEM; } ++nummx; } } if (!nummx) return dns_ip(ia,sa); /* e.g., CNAME -> A */ flagsoft = 0; while (nummx > 0) { unsigned long numsame; i = 0; numsame = 1; for (j = 1;j < nummx;++j) if (mx[j].p < mx[i].p) { i = j; numsame = 1; } else if (mx[j].p == mx[i].p) { ++numsame; random = random * 69069 + 1; if ((random / 2) < (2147483647 / numsame)) i = j; } switch(dns_ipplus(ia,&mx[i].sa,mx[i].p)) { case DNS_MEM: case DNS_SOFT: flagsoft = 1; break; } alloc_free(mx[i].sa.s); mx[i] = mx[--nummx]; } alloc_free(mx); return flagsoft; } Dave Sill <MaxFreedom@sws5.ornl.gov> wrote in message news:<wx0brfxkvgj.fsf@sws5.ornl.gov>... > ssin@comelong.com.hk (Stanley Sin) writes: > > > I , use the command "dig mx" , it shows the result : > > > > ;; res options: init recurs defnam dnsrch > > ;; res_nsend to server default -- 10.225.36.5: Operation timed out > > I use the dig command to other domain , it works properly. How can > > I solve this problem ? > > You can't, really. The remote site has a DNS problem. |
|
|||
|
ssin@comelong.com.hk (Stanley Sin) writes:
> Really thanks for your reply . Glad to help. > Today , I sent emails to the remote site again . It didn't the error > message "CNAME_lookup_failed_temporarily " , it showed the process > success. Howvever , the remote site was still not able to receive my > emails. Also , the dig command also showed the same result. If your logs show success, then the remote site accepted the message and qmail did its job. > I searched this problem from the web , some said it was a DNS problem > ,some said it was qmail can't receive over 512-byte DNS response . I > used dig command to dig aol.com , it showed the same "operation timed > out" result . but others work. > > As you said , it is a remote site DNS problem , how to tell him more > detailed to fix the DNS problem. You could do a "whois" on the domain and ring up the technical contact. > If part of the problem is caused by the packet size .I don't how to > amend the dns.c file to fix this problem. You should apply a patch to fix the DNS bug--whether that's causing your current problem or not. See: http://lifewithqmail.org/lwq.html#dns-patches But if dig is having problems, I don't think that's the problem in this case. -- Dave Sill Oak Ridge National Lab, Workstation Support Author, The qmail Handbook <http://web.infoave.net/~dsill> <http://lifewithqmail.org/>: Almost everything you always wanted to know. |
|
|||
|
S> used dig command to dig aol.com ,
At last, concrete (albeit sparse) information. <URL:http://homepages.tesco.net./~J.deBoynePollard/FGA/dns-edns0-and-firewalls.html> S> I don't how to amend the dns.c file to fix this problem. Then you didn't read the FAQTS entry for this subject properly. Read it again. <URL:http://www.faqts.com./knowledge_base/view.phtml/aid/28942/fid/284> |