域名

域名设置

注意!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

域名设置这一步骤非常重要,如果设置不当,就会出现邮件发不出,收不到等等问题……

以中国万网的域名管理为例,下面是中国万网的域名管理面板

Figure 1. Domain Name

  1. A 记录

    添加mail A记录,并解析到你服务器的IP

  2. MX 邮件交换记录

    添加mx 记录,并解析到你mail主机

  3. 保存设置

    保存设置后,一般会在48小时后生效

  4. 注意事项

    有一些域名提供商的mx 记录要在主机后加".",中国万网的不用,他们会自动给你加上。如果你的域名是在外国注册的。如美国,域名更新要4-7个工作日。

如果不想等48个小时,你可以修改你的系统DNS,设为你的域名提供商的DNS。这里以中国万网为例:

C:\>nslookup
Default Server:  apngw.sz002.nfht
Address:  192.168.0.253

> set type=ns
> net.cn
Server:  apngw.sz002.nfht
Address:  192.168.0.253

Non-authoritative answer:
net.cn  nameserver = sld-ns2.cnnic.net.cn
net.cn  nameserver = sld-ns3.cnnic.net.cn
net.cn  nameserver = sld-ns4.cnnic.net.cn
net.cn  nameserver = sld-ns5.cnnic.net.cn
net.cn  nameserver = cns.cernet.net
net.cn  nameserver = sld-ns1.cnnic.net.cn

sld-ns2.cnnic.net.cn    internet address = 202.97.16.197
sld-ns3.cnnic.net.cn    internet address = 210.52.214.85
sld-ns4.cnnic.net.cn    internet address = 61.145.114.119
sld-ns5.cnnic.net.cn    internet address = 61.139.76.54
cns.cernet.net  internet address = 202.112.0.24
sld-ns1.cnnic.net.cn    internet address = 159.226.1.3
> set querytype=ns
> www.net.cn
Server:  apngw.sz002.nfht
Address:  192.168.0.253

Non-authoritative answer:
www.net.cn      nameserver = dns2.hichina.com
www.net.cn      nameserver = dns1.hichina.com

dns2.hichina.com        internet address = 202.106.169.100
dns1.hichina.com        internet address = 218.30.103.50
> dns1.hichina.com
Server:  apngw.sz002.nfht
Address:  192.168.0.253

hichina.com
        primary name server = dns1.hichina.com
        responsible mail addr = hostmaster.hichina.com
        serial  = 2004040801
        refresh = 21601 (6 hours 1 sec)
        retry   = 3600 (1 hour)
        expire  = 1728000 (20 days)
        default TTL = 43200 (12 hours)
> dns2.hichina.com
Server:  apngw.sz002.nfht
Address:  192.168.0.253

hichina.com
        primary name server = dns1.hichina.com
        responsible mail addr = hostmaster.hichina.com
        serial  = 2004040801
        refresh = 21601 (6 hours 1 sec)
        retry   = 3600 (1 hour)
        expire  = 1728000 (20 days)
        default TTL = 43200 (12 hours)
> set type=a
> dns1.hichina.com
Server:  apngw.sz002.nfht
Address:  192.168.0.253

Non-authoritative answer:
Name:    dns1.hichina.com
Address:  218.30.103.50

> dns2.hichina.com
Server:  apngw.sz002.nfht
Address:  192.168.0.253

Non-authoritative answer:
Name:    dns2.hichina.com
Address:  202.106.169.100

>
> exit

C:\>
		

首先,单击开始菜单->运行->输入cmd。进入CLI(命令行界面)然后运行nslookup程序,nslookup会显示">"命令提示符

设置Internet 协议(TCP/IP)

Figure 2. Internet 协议(TCP/IP)属性

Linux

[root@linux root]# vi /etc/resolv.conf
nameserver 218.30.103.50
nameserver 202.106.169.100
		

测试你的域名

C:\>nslookup
Default Server:  apngw.sz002.nfht
Address:  192.168.0.253

> 9812.net
Server:  apngw.sz002.nfht
Address:  192.168.0.253

Name:    9812.net
Address:  202.103.190.130
> set type=ns
> 9812.net
Server:  apngw.sz002.nfht
Address:  192.168.0.253

Non-authoritative answer:
9812.net        nameserver = dns1.hichina.com
9812.net        nameserver = dns2.hichina.com

dns1.hichina.com        internet address = 218.30.103.50
dns2.hichina.com        internet address = 202.106.169.100
> set type=mx
> 9812.net
Server:  apngw.sz002.nfht
Address:  192.168.0.253

9812.net        MX preference = 10, mail exchanger = mail.9812.net
9812.net        nameserver = dns2.hichina.com
9812.net        nameserver = dns1.hichina.com
mail.9812.net   internet address = 202.103.190.130
dns2.hichina.com        internet address = 202.106.169.100
dns1.hichina.com        internet address = 218.30.103.50
>		
		

Linux CLI

[root@linux root]# nslookup
Note:  nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead.  Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
> 9812.net
Server:         202.96.128.68
Address:        202.96.128.68#53

Non-authoritative answer:
Name:   9812.net
Address: 202.103.190.130
> set type=mx
> 9812.net
Server:         218.30.103.50
Address:        218.30.103.50#53

9812.net        mail exchanger = 10 mail.9812.net.
> set type=ns
> 9812.net
Server:         202.96.128.68
Address:        202.96.128.68#53

Non-authoritative answer:
9812.net        nameserver = dns1.hichina.com.
9812.net        nameserver = dns2.hichina.com.

Authoritative answers can be found from:
>