域名

域名設置

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

域名設置這一步驟非常重要,如果設置不當,就會出現郵件發不出,收不到等等問題……

以中國萬網的域名管理為例,下面是中國萬網的域名管理面板

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:
>