Indy中查询DNS域名的问题,绝对崭新问题!(没分啦~抱歉)(4分)

  • 主题发起人 主题发起人 nickycheng
  • 开始时间 开始时间
N

nickycheng

Unregistered / Unconfirmed
GUEST, unregistred user!
在下面这篇文章中

用Delphi编写邮件特快专递程序
http://www.china-pub.com/computers/emook/wzq/056/info.htm
和 Indy的Demo:SMTPRelay中都有一个问题

DNS检索出来的收信服务器结果都有很多个域名。比如查xxx@hotmail.com的收信服务器,就会出来mx1.hotmail.com,ns1.hotmail.com,ns2.hotmail.com.....等等。结果发信的时候就会频繁报错,因为很多域名都是不接收邮件的。也就是说其中好像只有一个服务器是真正正确的。
如foxmail的邮件特快专递好像就能直接解析出正确的哪一个。
这到底是怎么实现的呢??

请各位研究研究啊。我看那个倒霉rfc文档好几天了,都没找到点有用的东西

==========================
我找到一些资料:


域名解析结果样例

Answer List

Resource name is : sina.com
Type is : MX Class is : IN
MX Priority : 10 MX Server : mailcn.sina.com

Resource name is : sina.com
Type is : MX Class is : IN
MX Priority : 15 MX Server : mail.sina.com.cn


Authority List

Resource name is : sina.com
Type is : NS Class is : IN
Domain name is : resolver.sina.com

Resource name is : sina.com
Type is : NS Class is : IN
Domain name is : ns2.sina.com


Additional Response List

Resource name is : mailcn.sina.com
Type is : A Class is : IN
IP Address is : 202.106.184.233

Resource name is : mail.sina.com.cn
Type is : A Class is : IN
IP Address is : 202.106.187.150

Resource name is : resolver.sina.com
Type is : A Class is : IN
IP Address is : 206.204.114.135

Resource name is : ns2.sina.com
Type is : A Class is : IN
IP Address is : 209.133.24.135

===================================

Network Working Group P. Mockapetris
Request for Comments: 1035 ISI
November 1987
Obsoletes: RFCs 882, 883, 973

DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION


4. MESSAGES

4.1. Format

All communications inside of the domain protocol are carried in a single
format called a message. The top level format of message is divided
into 5 sections (some of which are empty in certain cases) shown below:

+---------------------+
| Header |
+---------------------+
| Question | the question for the name server
+---------------------+
| Answer | RRs answering the question
+---------------------+
| Authority | RRs pointing toward an authority
+---------------------+
| Additional | RRs holding additional information
+---------------------+

The header section is always present. The header includes fields that
specify which of the remaining sections are present, and also specify
whether the message is a query or a response, a standard query or some
other opcode, etc.

The names of the sections after the header are derived from their use in
standard queries. The question section contains fields that describe a
question to a name server. These fields are a query type (QTYPE), a
query class (QCLASS), and a query domain name (QNAME). The last three
sections have the same format: a possibly empty list of concatenated
resource records (RRs). The answer section contains RRs that answer the
question; the authority section contains RRs that point toward an
authoritative name server; the additional records section contains RRs
which relate to the query, but are not strictly answers for the
question.


我想可以接收邮件的服务器就是分类在Answer中的。但是我不知道怎样用Indy或是DNSQuary查询出对应的服务器地址。
朋友们帮帮忙啦
 
凑巧我做过类似的东西。 DNS解析出来的MX纪录应该都是可以用的,因为这些MX纪录
就是域名所有者自己设置的,如果不能用他设置这些干什么?

当然,不排除正好某台MX纪录的机器死机的情况。你可以一个一个尝试啊!
 
如下
| Answer | RRs answering the question
+---------------------+
| Authority | RRs pointing toward an authority
+---------------------+
| Additional | RRs holding additional information
据我理解
Answer应该是有应答的邮件服务器。
Authority应该是需要认证的服务器,在下面一个我不太明白是什么意思。
那么我想如果通过本地直接发到对方的服务器上,只能选择Answer的。

大家再看看
 
后退
顶部